Skip to content

Secrets and permissions

Anna Sancho Vaquer edited this page Oct 21, 2026 · 4 revisions

This page lists every secret and permission the template can use. Secrets are created in your repository (or organization) under Settings → Secrets and variables → Actions.

The workflows pass all available secrets to the reusable workflows (secrets: inherit), so organization-level secrets shared with the repository work too.

Summary

Secret Needed when
REPO_CLONER_TOKEN The repository is private or internal
Registry credentials (your names) Publishing to additional registries
Pro token and passphrase (your names) Building Ubuntu Pro rocks
GITHUB_TOKEN Always, but automatic

REPO_CLONER_TOKEN

Important

Required if your repository is internal or private. Public repositories do not need it.

The build runs in reusable workflows that check out your repository, which they cannot do on private repositories with the default token. Create a fine-grained personal access token with these repository permissions:

Permission Access
Contents Read
Metadata Read

Then:

  • Set the token's resource owner to the organisation that owns the repository (for example canonical).
  • Grant it access to the right repositories. Public-only access is not enough.
  • Store it as a secret named exactly REPO_CLONER_TOKEN.

Note

Fine-grained tokens expire. If builds suddenly fail while checking out the repository, check that the token is still valid.

Referencing secrets in ci.yaml

Registry and Pro credentials have names you choose. In .github/ci.yaml you refer to a secret by writing secrets. followed by its name:

username: secrets.DOCKERHUB_USERNAME

This means "use the repository secret called DOCKERHUB_USERNAME". Values that do not start with secrets. are rejected by the validation.

Caution

ci.yaml is committed to the repository. It must only contain the names of secrets, never their values.

Additional registries

Create the secrets listed for the method you use. The names are up to you; they just need to match what you write in ci.yaml.

Method Secrets to create
basic A username and a password (or access token)
ecr, ecr-public An AWS access key ID and an AWS secret access key (the region is not secret)

See Publishing to registries for examples.

Pro rocks

Create two secrets and reference them from the image's pro.config:

pro.config key Secret contents
token Your Ubuntu Pro token
artifact-passphrase A passphrase you choose; it encrypts the Pro build artifacts between jobs. Use a long, random value.

GITHUB_TOKEN and workflow permissions

GITHUB_TOKEN is created automatically for each run, and is not something you configure. The workflows request only the access they need:

Workflow Permissions Why
rock.yml (Rock pipeline) packages: write Push images to GHCR
threats.yml (Threat monitor) contents: read, packages: read Read the repository and pull published images from GHCR

If you modify the workflows, keep these permissions as narrow as possible.

Clone this wiki locally