Interview Prep/GitHub Actions/Secrets, Variables, Environments & Permissions

What is the difference between `GITHUB_TOKEN`, a fine-grained PAT, and a GitHub App token in workflows?

IntermediateConceptSecrets, Variables, Environments & Permissions
Answer
  • GITHUB_TOKEN: automatic, per job, single repo, expires at job end, cannot trigger workflows. Default choice.
  • Fine-grained PAT: tied to a person, multi-repo, long-lived; breaks when the person leaves, and actions appear as them. Avoid.
  • GitHub App token: minted at runtime with actions/create-github-app-token, scoped to selected repos and permissions, valid one hour, acts as the app, does trigger workflows. Use for cross-repo access and release automation.
- id: app
  uses: actions/create-github-app-token@v2
  with:
    app-id: ${{ vars.RELEASE_APP_ID }}
    private-key: ${{ secrets.RELEASE_APP_KEY }}
    repositories: shack-api,shack-helm
All GitHub Actions questions Roadmap: GitHub Actions

More on Secrets, Variables, Environments & Permissions