Create a PAT
Deprecated
A new and improved CI/CD rig is coming soon. Planning to set up a new CI/CD pipeline? Reach out to us in team Utviklerflyt and we'll get you started with the latest setup. We expect to publish updated documentation in March.
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.
Before you begin
You should have:
- A GitHub machine user ("bot account").
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.
Enter these values:
- Token name
-
pirates-iac-cicd(replacepirates-iacwith 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.