AuthenticationGitHub
GitHub Apps or personal access tokens for automation
A personal access token acts as a person, and it stops working when that person loses access. A GitHub App acts as itself and issues tokens that expire after one hour.

What each credential is tied to
A personal access token is associated with a user. GitHub's documentation says your automation could break if that user no longer has access to the resources it needs.
A GitHub App can act independently of a user. It is not tied to a user account and does not consume a seat. It stays installed when the person who installed it leaves the organization.
Installation tokens and permissions
Whoever installs the app decides which repositories it can reach. Its permissions are fine-grained: an app can request read-only access to repository contents, which does not let it edit the contents or the settings.
To call the API, the app signs a JWT with its private key and exchanges it for an installation access token. That token expires after one hour. A request for a token can narrow it further, to named repositories and to a subset of the app's permissions.
Private keys do not expire and must be revoked manually. An app can have up to 25, and GitHub recommends several so that you can rotate keys with no downtime. Its documentation calls the private key the single most valuable secret for a GitHub App and says to consider storing it in a key vault.
GitHub began a staged rollout of a new installation token format on 27 April 2026. Code that relies on a token being exactly 40 characters long may not handle it.
Rate limits
- A personal access token shares its user's limit of 5,000 REST API requests an hour with every other token and app that acts for that user.
- An installation token has a minimum of 5,000 requests an hour. Outside GitHub Enterprise Cloud, an installation with more than 20 repositories gets another 50 an hour for each repository, and one on an organization with more than 20 users gets another 50 for each user. The limit cannot go beyond 12,500.
- An installation on a GitHub Enterprise Cloud organization has 15,000 requests an hour.
- The built-in
GITHUB_TOKENhas 1,000 requests an hour for each repository.
An app token in a workflow
Register the app with the permissions the job needs and install it on the repositories. Store its client ID as a configuration variable and its private key as a secret. This is the workflow from GitHub's documentation. APP_CLIENT_ID and APP_PRIVATE_KEY are the names it gives to that variable and that secret:
on:
workflow_dispatch:
jobs:
demo_app_authentication:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Use the token
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
gh api octocatThe action's README documents the inputs that set the token's reach:
- With no
ownerand norepositories, the token covers only the current repository. ownerwith norepositoriescovers all repositories in that owner's installation.repositoriestakes a list of names.- With no
permission-inputs, the token inherits all of the installation's permissions. The README recommends listing the permissions a job requires, for examplepermission-contents: read. - The action revokes the token when the job is complete, so it cannot be passed to another job.
- The
app-idinput is deprecated in favor ofclient-id.
Where a personal access token is fine
GitHub's documentation names two uses for personal access tokens: testing the API and scripts with a short life. It describes them as intended for access to GitHub resources on behalf of yourself.
For those uses, create a fine-grained token, give it an expiration and limit it to the repositories it needs. For access on behalf of an organization, or for a long-lived integration, the same documentation says to use a GitHub App.
How to choose
- A workflow that touches only its own repository: the built-in
GITHUB_TOKEN. It can only access resources within the workflow's repository. - A workflow or service that needs resources in another repository or in an organization: a GitHub App.
- A pull request opened by automation whose workflow runs must start with no approval: a GitHub App installation token or a personal access token. When
GITHUB_TOKENopens the pull request, the resulting runs wait for approval. - One person's script or an API test: a fine-grained personal access token with an expiration.
Then list the tokens your pipelines use and name the owner of each. Move the ones that serve a team to a GitHub App first.
Sources
- Deciding when to build a GitHub App
- Generating an installation access token for a GitHub App
- Managing private keys for GitHub Apps
- Making authenticated API requests with a GitHub App in a GitHub Actions workflow
- Rate limits for the REST API
- actions/create-github-app-token
- Managing your personal access tokens
- GITHUB_TOKEN
Want a second pair of eyes on yours? We do this work for a living.
More guides

Fine-grained personal access tokens on GitHub
Authentication · 4 min read
What a fine-grained token limits, what it cannot do today, and when a GitHub App fits better.

GITHUB_TOKEN permissions: set them for every job
Authentication · 3 min read
The default setting, the permissions key at workflow and job level, and what fork pull requests get.

Deploy keys, SSH keys and machine users on GitHub
Authentication · 4 min read
The credentials a server can use to reach a repository, what each one covers, and how to choose.