Create a PAT
This section shows you how to create a Personal Access Token (PAT) in GitHub that allows it to:
- Read and write files in your infrastructure repository.
- Send a dispatch event to your infrastructure repository.
Step 1: Create a PAT
To create the PAT, go to the GitHub machine user and select Settings > Developer settings > Personal access tokens > Fine-grained tokens and enter the following values:
- Token name
-
pirates-iac-cicd
(replacepirates-iac
with your own repository) - Expiration
-
Today's date plus one year.
- Description
-
Used in GitHub Actions workflows to send dispatch events and update image tags in the infrastructure repository.
- Resource owner
-
oslokommune
- Repository access - only select repositories
-
pirates-iac
(replace with your infrastructure repository) - Repository permissions
-
Contents > Read and write
Click Generate token.
Step 2: Save in 1Password
Add the token to your team's 1Password vault, note the machine user name that was used to generate it.
Why should I store the token in 1Password?
You will use this PAT as a secret in both the application and infrastructure repository. GitHub only displays the key once, so putting it in 1Password makes it more convenient to fetch later.