github-app-token
github-app-token copied to clipboard
Add an optional input `repository_ids`
What?
Add an optional input repository_ids, which is a list of repository IDs that the token should have access to.
https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app
repository_ids: >-
[${{github.repository_id}}]
Why?
To limit repositories.
The advantage of repository_ids compared with repositories is that we can get repository_id from github context's github.repository easily.
On the other hand, it is a little difficult to get a repository name from github context.
I opened a pull request to resolve the issue.
- https://github.com/tibdex/github-app-token/pull/107
On the other hand, it is a little difficult to get a repository name from github context.
We can get a repository name from github context like this.
repositories: >-
["${{github.event.repository.name}}"]
But a repository id is simpler and well documented than a repository name.