GitHub Action which gets an auth token for a repo or organization via a GitHub app installation
A credential bundle should be generated for the GitHub app using these
instructions and provided as the creds
input.
- To generate an org-scoped token, provide only the
org
input - To generate a repo-scoped token, provide
owner
andrepo
inputs
Note
By default the owner
and repo
inputs refer to the current repository, so
they do not need to be provided unless the token is needed for a different
repository.
jobs:
issue-commented:
name: Remove label on comment
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
uses: electron/[email protected]
id: generate-token
with:
creds: ${{ secrets.GH_APP_CREDS }}
- name: Remove label
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
ISSUE_URL: ${{ github.event.issue.html_url }}
run: |
gh issue edit $ISSUE_URL --remove-label 'blocked/need-repro'
creds
- (required) A credential bundle for the GitHub app to generate the token fororg
- (optional) The organization for an org-scoped tokenowner
- (optional) The repository owner for a repo-scoped tokenrepo
- (optional) The repository name for a repo-scoped tokenexport-git-user
- (optional) Export environment variables which set the Git user to the GitHub app user
token
- GitHub App installation access token
MIT