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

Add content write permissions to release jobs #1555

Merged

Conversation

dgrisonnet
Copy link
Member

This should work around the org-wide restriction on github actions write permission to the repos and fix the issue I encountered when releasing v0.7.2 where the jobs to publish the assets failed: https://github.com/kubernetes-sigs/metrics-server/actions/runs/10593979544

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 29, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If metrics-server contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 29, 2024
Copy link
Contributor

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

Is it worth explicitly setting the default workflow level permissions for the other 2 workflows in this PR?

.github/workflows/release.yaml Outdated Show resolved Hide resolved
.github/workflows/release-chart.yaml Outdated Show resolved Hide resolved
@dgrisonnet
Copy link
Member Author

@stevehipwell I udpated the PR, is this what you had in mind? I removed the top-level permissions entirely as these are inherited from the repo settings which sets everything to read-all.

Copy link
Contributor

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

@dgrisonnet setting the top level permissions is a best practice as it stops accidental (or deliberate) permission creep. Tools such as the OSSF Scorecard will warn if this isn't set.

FYI I can recommend using https://app.stepsecurity.io/secureworkflow with the agent option unchecked to check GH workflows are secure, this is what the OSSF Scorecard recommends using too.

@dgrisonnet
Copy link
Member Author

Oh I see, that makes sense. Thanks for the tip, I'll run the workflow through that tool

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 29, 2024
@stevehipwell
Copy link
Contributor

@dgrisonnet I still think it'd be worth adding the default to the other workflows while you're doing these ones.

@stevehipwell
Copy link
Contributor

@dgrisonnet are you still working on this?

@dgrisonnet
Copy link
Member Author

Yes sorry about that, I missed your last comment

@stevehipwell
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 3, 2024
Copy link
Contributor

@yangjunmyfm192085 yangjunmyfm192085 left a comment

Choose a reason for hiding this comment

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

/test pull-metrics-server-verify

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgrisonnet, yangjunmyfm192085

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 78b132f into kubernetes-sigs:master Sep 4, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants