Skip to content
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

✨ Allow contents: write for Token-Permissions when doing mvn release #2202

Merged
merged 2 commits into from
Aug 26, 2022

Conversation

katzj
Copy link
Contributor

@katzj katzj commented Aug 26, 2022

What kind of change does this PR introduce?

This allows workflow steps that call 'mvn release:prepare' to use contents: write permissions as they are needed for doing the maven release process.

(Is it a bug fix, feature, docs update, something else?)

Somewhere between a bug and a feature

What is the current behavior?

Current behavior is that a workflow that is doing mvn release will get dinged on the Token-Permissions check due to contents: write permission for that workflow

What is the new behavior (if this is a feature change)?**

A workflow using mvn release:prepare will be allowed the contents: write permission without lowering the score

  • Tests for the changes have been added (for bug fixes/features)

Which issue(s) this PR fixes

NONE

Special notes for your reviewer

Does this PR introduce a user-facing change?

The Token-Permissions check no longer penalizes workflows with the `contents: write` permission if they are using it to run `mvn release:prepare`.

mvn release:prepare makes changes to the repo to bump versions,
create a tag, and get things prepared for doing a release build
and thus needs contents: write permissions. This looks for workflow
steps that call `mvn release:prepare` and includes them in the set
that are a releasing workflow and thus which allow contents:write
@katzj katzj temporarily deployed to integration-test August 26, 2022 20:46 Inactive
@katzj katzj changed the title Allow contents: write for Token-Permissions when doing mvn release ✨ ✨ Allow contents: write for Token-Permissions when doing mvn release Aug 26, 2022
@github-actions
Copy link

Integration tests success for
[14e57f7]
(https://github.com/ossf/scorecard/actions/runs/2936484651)

@codecov
Copy link

codecov bot commented Aug 26, 2022

Codecov Report

Merging #2202 (99cdd2a) into main (a8e9050) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #2202      +/-   ##
==========================================
- Coverage   41.92%   41.87%   -0.06%     
==========================================
  Files          95       95              
  Lines        7935     7945      +10     
==========================================
  Hits         3327     3327              
- Misses       4348     4358      +10     
  Partials      260      260              

Copy link
Contributor

@laurentsimon laurentsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this is great!

checks/raw/permissions.go Show resolved Hide resolved
@laurentsimon laurentsimon enabled auto-merge (squash) August 26, 2022 22:27
@laurentsimon laurentsimon temporarily deployed to integration-test August 26, 2022 22:27 Inactive
@laurentsimon laurentsimon merged commit 6fc08e7 into ossf:main Aug 26, 2022
@github-actions
Copy link

Integration tests success for
[99cdd2a]
(https://github.com/ossf/scorecard/actions/runs/2936932063)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants