Task: create a GitHub repository secret.
The instructions pertain to the creation of any repository secret.
By way of example, we create a repository secret ASSIGN_REVIEWERS
that we will use when creating the GitHub action Auto Assign.
Create a Personal Access Token (PAT)
In order to create a repository secret, it's first necessary to create a PAT.
Tip: for an overview of how PATs and secrets are related, we recommend reading the summary written by Claude in the appendix before continuing.
How to create a PAT
- Navigate to Developer Settings > Personal Access Tokens > Tokens (classic)
- Click "Generate new token (classic)"
- Give it a descriptive e.g. "Auto Assign Reviewers"
- Set an expiry date. if you're not sure, err on the side of caution. You can always create another PAT.
- Select the workflow scope for the necessary permissions (this will automatically select repo which is also required)
- Copy the token immediately. This is critical; you won't be able to access it later. If you don't copy the token now, you will have to create a new one.
How to create a repository secret
Once you have copied the PAT:
- Navigate to Settings > Secrets and variables > Actions e.g. actionsNote: repository secrets are for a single repository only. You will find them in your repository settings under "Secrets and variables".
- Click "New repository secret"
- Name: e.g. ASSIGN_REVIEWERS
- Value: the PAT you just created
You can review and manage secrets at ~/settings/secrets/actions e.g. secrets/actions
You can now use the repo secret in a GitHub action to grant permissions.