Skip to content

ci: reduce workflow-level permissions to least privilege#1033

Merged
rfgamaral merged 1 commit intomainfrom
ricardo/reduce-release-workflow-permissions
Apr 8, 2026
Merged

ci: reduce workflow-level permissions to least privilege#1033
rfgamaral merged 1 commit intomainfrom
ricardo/reduce-release-workflow-permissions

Conversation

@rfgamaral
Copy link
Copy Markdown
Member

Short description

Reduces the release workflow's default GITHUB_TOKEN permissions to the minimum required. Since semantic-release now uses the GitHub App token for all write operations (pushing commits, creating releases, commenting on issues/PRs), the workflow token only needs id-token: write (OIDC provenance), packages: write (GitHub Packages publish), and contents: read (CI validation checkout).

Backported from Doist/typist#1291 and Doist/typist#1292.

PR Checklist

  • Reviewed and approved Chromatic visual regression tests in CI

semantic-release uses the GitHub App token for all write operations,
so the workflow's default GITHUB_TOKEN only needs id-token (OIDC
provenance), packages (GitHub Packages publish), and contents read
(for the CI validation workflow to checkout the repository).
@rfgamaral rfgamaral self-assigned this Apr 8, 2026
@rfgamaral rfgamaral added the 👀 Show PR Used for PRs that need a review, but can be merged when CI is green. label Apr 8, 2026
@rfgamaral rfgamaral requested review from a team and pedroalves0 and removed request for a team April 8, 2026 12:56
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

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

This PR improves security by reducing the release workflow's GITHUB_TOKEN permissions to the principle of least privilege. This update ensures safer automation and better maintainability now that write operations are handled by the GitHub App token. A minor note was raised regarding a copy-pasted comment that could be updated to better reflect its new context.

Share FeedbackReview Logs

@rfgamaral rfgamaral merged commit 3aee335 into main Apr 8, 2026
8 of 9 checks passed
@rfgamaral rfgamaral deleted the ricardo/reduce-release-workflow-permissions branch April 8, 2026 12:59
Copy link
Copy Markdown
Member

@pedroalves0 pedroalves0 left a comment

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👀 Show PR Used for PRs that need a review, but can be merged when CI is green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants