Uh oh!
There was an error while loading. Please reload this page.
Restrict GitHub Actions workflow permissions to least privilege - #1718
Merged
Conversation
By default, the GITHUB_TOKEN in Actions workflows has broad read-write access, which is a security risk if a workflow or any of its third-party actions is compromised. All five workflows in this repo only need read access to repository contents through the default token, since the ones that publish releases or push commits already use dedicated PATs or GitHub App tokens for those operations. The only exception is the NPM release workflow, which additionally needs packages:write to publish to GitHub Packages.
Uh oh!
There was an error while loading. Please reload this page.
philippschulte
requested changes
Apr 7, 2026
philippschulte
left a comment
Member
There was a problem hiding this comment.
This looks mostly good but I am not sure if removing id-token: write in publish_release.yml may break the release workflow if it relies on OIDC anywhere.
jedisct1
commented
Apr 7, 2026
ContributorAuthor
Hi Philipp,
The workflow doesn't seem to use OIDC anywhere. It authenticates to npm via a token from I don't think |
jedisct1
enabled auto-merge (squash)
April 8, 2026 14:56
Uh oh!
There was an error while loading. Please reload this page.
3 tasks
anthony-gomez-fastly pushed a commit
that referenced
this pull request
Apr 13, 2026
### Change summary This PR restores a permission in the workflow that had been removed in #1718 that is needed for publishing to NPM. Publishing to NPM using trusted publishing requires `id-token: write` as added in #1644. ### New Feature Submissions: * [x] Does your submission pass tests? ### Changes to Core Features: * [ ] Have you written new tests for your core changes, as applicable? * [ ] Have you successfully run tests with your changes locally? ### Are there any considerations that need to be addressed for release? A new point release (14.3.1) would be needed to get this version into NPM.
jedisct1 added a commit
to dip-proto/fastly-cli
that referenced
this pull request
Apr 14, 2026
* main: build(deps): bump the go-dependencies group with 5 updates (fastly#1726) release 14.3.1 (fastly#1725) Restore permission for trusted publishing (fastly#1724) Release 14.3.0 (fastly#1723) [CDTOOL-1193] Support for Logging Endpoint Errors (fastly#1721) chore(deps): bump go-fastly to 14.2.0 (fastly#1722) Add --json / -j flag to all stats subcommands (fastly#1719) build(deps): bump the go-dependencies group with 4 updates (fastly#1720) Add "auth revoke" subcommand for token revocation (fastly#1717) Restrict GitHub Actions workflow permissions to least privilege (fastly#1718)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change summary
By default, the
GITHUB_TOKENin Github actions workflows has broad read-write access, which is a security risk if a workflow or any of its third-party actions is compromised.This change adds explicit
permissionsblocks to all five workflows, restricting the default token tocontents: readonly.Workflows that publish releases or push commits already use dedicated PATs or GitHub App tokens for those operations, so they don't need write access on the default token.
The only exception is the NPM release workflow, which additionally needs
packages: writeto publish to GitHub Packages.All Submissions:
User Impact
None. This only affects CI workflow permissions and does not change any CLI behavior.
Are there any considerations that need to be addressed for release?
None.