-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to set minimum token permissions for the GITHUB_TOKEN in yaml files #779
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ on: | |
paths: | ||
- version.txt | ||
|
||
permissions: | ||
contents: read | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one needs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is just to set the minimum default access as read for all jobs in the workflow. I think it will not affect the existing job since we already have a job specific write permission for that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I didn't notice the job's config, thanks. |
||
|
||
jobs: | ||
tag: | ||
if: ${{ github.repository == 'kubernetes/cloud-provider-aws' }} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm what's the effect of this if the only job bumps its permissions to
write
? Just covering our bases when/if anotherjob
is added?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the top-level permissions tag will only provide minimum access which can be overridden by job-level permissions tag. It is placed as a security measure.
Adding reference for this: Assigning permissions to jobs