-
Notifications
You must be signed in to change notification settings - Fork 509
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
✨ Token-Permissions, Allow contents: write
permission only for jobs that are releasing
#1663
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1663 +/- ##
==========================================
+ Coverage 55.86% 61.69% +5.82%
==========================================
Files 72 58 -14
Lines 6508 5801 -707
==========================================
- Hits 3636 3579 -57
+ Misses 2618 1979 -639
+ Partials 254 243 -11 |
Integration tests success for |
Allowing `contents: write` permission only for jobs that are releasing jobs, not just packaging jobs.
5967ad5
to
577a8fd
Compare
Integration tests success for |
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.
Thanks
} | ||
|
||
// matches returns true if the job matches the job matcher. | ||
func (m *JobMatcher) matches(job *actionlint.Job) bool { |
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.
Similar comment , should this be a job *actionlint.Job
pointer?
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.
Thanks Chris!
checks/testdata/.github/workflows/github-workflow-permissions-contents-writes-release.yaml
Outdated
Show resolved
Hide resolved
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.
Thanks Chris!
Integration tests success for |
Integration tests success for |
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature
What is the current behavior? (You can also link to an open issue here)
If a GitHub workflow job has
contents: write
permission and it is a publishing job, it will not have its score reduced.Feature: differentiate between
package
andcontents
permission in Token-Permission #1254What is the new behavior (if this is a feature change)?
If a GitHub workflow job has
contents: write
permission and it is a publishing job, it will have its score reduced. If a GitHub workflow job hascontents: write
permission and it is a releasing job, it will not have its score reduced.Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No
Other information:
I looked through all of
isPackagingWorkflow
and determined the only ones that looked like they neededcontents: write
weregoreleaser
andpython-semantic-release
. I leftgoreleaser
inisPackagingWorkflow
so as not to alter the behavior of the Packaging check, even though that action does not need thepackages: write
permission.python-semantic-release
requires bothpackages: write
andcontents: write
.