Back

Generate a fine-grained access token on GitHub

A least-privilege GitHub token, created or regenerated and stored only where you need it

Engineering
Prompt

Create a fine-grained personal access token on GitHub for [purpose, e.g. CI deploys from my hosting platform]. Go to Settings > Developer settings > Fine-grained tokens. If a token named [token name] already exists, show me its expiry, repo access, permissions, and last use, and ask whether to regenerate it instead of creating a duplicate. Otherwise generate one with name [token name], expiration [e.g. 90 days], resource owner [my account or an org], repository access [e.g. only owner/repo-a], and only these permissions: [e.g. Contents read and write, Metadata read]. If GitHub asks for my password, 2FA, or org approval, stop and tell me. The token shows once. If I named a destination [e.g. a secret called GITHUB_TOKEN in my deploy service], paste it there and confirm it saved; otherwise give it to me. Write it nowhere else. Finish with a short summary: name, expiry, repos, permissions, where it is stored, and its last four characters.

Works withgithub.com