Skip to content

ci: declare GITHUB_TOKEN permissions in all workflows - #384

Merged
shunki-fujita merged 1 commit into
mainfrom
ci-token-permissions
Sep 25, 2026
Merged

shunki-fujita merged 1 commit into
mainfrom
ci-token-permissions

Conversation

@shunki-fujita

Copy link
Copy Markdown
Contributor

What

Declare GITHUB_TOKEN permissions in both workflows.

  • ci.yaml: workflow-level contents: read. The jobs only check out the repository and run tests; none of them calls the GitHub API.
  • release.yaml: workflow-level contents: read, plus packages: write on the image job (docker login + push to ghcr.io) and contents: write on the release job (gh release create).

Why

The repository currently relies on the default token permissions (write), and no job declares what it needs. Declaring them per job lets us switch the repository default to read-only afterwards without breaking the release workflow.

Checks

  • upload-artifact and actions/cache use the runtime token, not GITHUB_TOKEN, so they are unaffected.
  • aqua-installer does not receive GITHUB_TOKEN in these workflows.

Set the workflow-level default to contents: read and grant write scopes
only to the release jobs that need them: packages: write for pushing
the container image and contents: write for creating the GitHub
release. The CI jobs only check out the repository and run tests, so
they do not need any write scope.

This is a prerequisite for switching the repository's default
GITHUB_TOKEN permissions to read-only.
@terassyi
terassyi self-requested a review September 18, 2026 07:52

@terassyi terassyi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shunki-fujita
shunki-fujita merged commit 563f476 into main Sep 25, 2026
28 checks passed
@shunki-fujita
shunki-fujita deleted the ci-token-permissions branch September 25, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants