chore(actions): Adjust GitHub Actions permissions (write for release, read-only for others)#2154
Merged
chore(actions): Adjust GitHub Actions permissions (write for release, read-only for others)#2154
Conversation
… read-only for others)
shino
reviewed
Mar 24, 2025
Collaborator
shino
left a comment
There was a problem hiding this comment.
Scorecard page https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions says:
The highest score is awarded when the permissions definitions in each workflow's yaml file are set as read-only at the top level and the required write permissions are declared at the run-level.
It's depending on the aims we want to achive, but how about changing top-level of goreleaser.yml to read and adding contents: write to "Run GoReleaser" step? Maybe too bureaucratic? :)
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 free
to 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.
What did you implement:
This pull request includes changes to multiple GitHub Actions workflow files to add permissions settings. These changes ensure that the workflows have the appropriate read or write permissions for the contents they interact with.
Changes to GitHub Actions workflows:
.github/workflows/build.yml: Addedcontents: readpermissions..github/workflows/codeql-analysis.yml: Addedcontents: readpermissions..github/workflows/docker-publish.yml: Addedcontents: readpermissions..github/workflows/golangci.yml: Addedcontents: readpermissions..github/workflows/goreleaser.yml: Addedcontents: writepermissions..github/workflows/test.yml: Addedcontents: readpermissions.For details, see: https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
Type of change
How Has This Been Tested?
Please verify whether the Goreleaser YAML works correctly in the real environment the next time we create a tag.
Checklist:
make fmtmake testIs this ready for review?: YES