Keys / GitHub
GITHUB_TOKEN
A GitHub token your app or script calls the GitHub API with. In GitHub Actions, GitHub also creates one for every job.
- Expires
- you choose, or never; in Actions, when the job ends
- API
- none; dashboard only
Get it
Create one on github.com/settings/personal-access-tokens/new. The steps aren't recorded yet.
Set it
GITHUB_TOKEN=...
GitHub CLI (gh) reads it when GH_TOKEN isn't set; Octokit doesn't, so the app passes it in. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- Create a new fine-grained token with the same repositories and permissions, or a classic token with the same scopes.
- Deploy it everywhere that reads
GITHUB_TOKEN. - Check that nothing still uses the old token, then delete it under Developer settings > Personal access tokens.
- In Actions,
secrets.GITHUB_TOKENis new for every job, so there's nothing to replace.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.