fix(ci): status check workflows permissions#81
Merged
Conversation
a4cf907 to
84601b0
Compare
84601b0 to
4440645
Compare
fernandatoledo
approved these changes
Oct 24, 2024
Collaborator
fernandatoledo
left a comment
There was a problem hiding this comment.
The description of this PR is super complete! 👏
juanchoperezj
approved these changes
Oct 25, 2024
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 does this do?
This PR changes the Lint, Test and Type-Check workflows to specifically set the minimum permissions they need.
Why did you do this?
The workflows (and thus, the status checks of all Pull Requests and pushes) weren't working if the default permissions granted to the
GITHUB_TOKENwere set to "Read" instead of "Read and Write" in the project repository.Nonetheless, GItHub recommends to "only allow the minimum required access" to the workflow files.
What is this?
GITHUB_TOKENsecret is used by all of these workflows to perform operations such as reading our PRs and creating comments on them.permissionsare specified in a workflow file, theGITHUB_TOKENwill have the default permissions set in the repository configuration (Repository settings > Actions > General > Workflow permissions).GITHUB_TOKENat the repository level. In other words, sometimes we can't even change the default permissions to "Read and write." More information here.GITHUB_TOKENare set to "Read", we recommend specifying and overriding the permissions for each workflow file on a more fine-grained basis.Who/what does this impact?
Repositories with restricted access.
How did you test this?
I tested the workflow in a temporal test repository.