-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
GitHub Workflows security hardening #2899
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 from 2 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,8 +8,13 @@ on: | |
|
|
||
| concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
|
||
| permissions: {} | ||
|
Member
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. q: is this required if explicit permissions are specified for one of the jobs?
Contributor
Author
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. It is optional. I added it prevent the case when a new job is added and it inherits the default permissions, but as long as there is only one job it will use it's own permissions. |
||
| jobs: | ||
| release: | ||
| permissions: | ||
| contents: write # to create release | ||
| pull-requests: write # to create pull request | ||
|
Member
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. are you a Changeset user? did you have a chance to confirm that those are the only ones needed for this action?
Contributor
Author
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.
Contributor
Author
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 didn't have a chance to try it. If it fails it can be expanded.
Andarist marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| name: Release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
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.
shouldn't this only be granted for
actions/checkout?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.
Permissions are per job unfortunately, not per step. All jobs do checkout, so it makes sense to define it a global.