-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Add token permissions for ci/erlang.yml #1341
Changes from 1 commit
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 |
---|---|---|
|
@@ -6,10 +6,14 @@ on: | |
pull_request: | ||
branches: [ $default-branch ] | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
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. I believe 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. My understanding is that when a new GitHub org or repo is created, the default GitHub Action token permissions are permissive. By that I mean that all permissions are granted to the Moreover, while writing the starter workflows, we do not know what is the token permission set at the org/ repo level for whoever will use the workflow. So, the permissions should be specified in the workflow file. 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.
That's a good point in case of permissive repos/orgs. 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. However, given that we have already specified a workflow level read permission, this job level permission seems redundant. 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. @bishal-pdMSFT this is good feedback. Since the changes are done via automation, I would want to address this via a configuration option in the automation. What if there is a configuration option to CC: @laurentsimon 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. @laurentsimon please see feedback on this PR. The ask is to set 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.
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.
Yes. Thanks! I will make this change. 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. @bishal-pdMSFT the logic has been updated to add 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. @bishal-pdMSFT - reminder to please review this. Thanks! |
||
runs-on: ubuntu-latest | ||
|
||
container: | ||
|
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.
Why is this needed?
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.
This permission at the workflow (top) level is so that any future jobs that get added to the same workflow are secure by default. It also makes the changes in-line with expectation from ossf/scorecard. You can see the discussion here.
CC: @laurentsimon
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.
The discussion ⬆️ was good read. Thanks!
And I agree it makes sense to add permission at workflow level for new jobs.