Skip to content

electron/github-app-auth-action

Repository files navigation

GitHub App Auth Action

GitHub Super-Linter CI

GitHub Action which gets an auth token for a repo or organization via a GitHub app installation

Usage

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 and repo 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.

Example

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'

Inputs

  • creds - (required) A credential bundle for the GitHub app to generate the token for
  • org - (optional) The organization for an org-scoped token
  • owner - (optional) The repository owner for a repo-scoped token
  • repo - (optional) The repository name for a repo-scoped token
  • export-git-user - (optional) Export environment variables which set the Git user to the GitHub app user

Outputs

  • token - GitHub App installation access token

License

MIT