Skip to content

github: restrict workflow permissions #6333

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

Merged
merged 1 commit into from
Mar 4, 2025
Merged

Conversation

psafont
Copy link
Member

@psafont psafont commented Feb 28, 2025

Removes all default permissions, and only adds needed permissions to the workflows that need it.

  • read contents: allows reading the repository, most workflows need this
  • write contents: allows to write to the repository. Needed to create releases
  • write pull-requests: allows to manipulate pull requests. Unfortunately this is needed to comment on PRs
  • read actions: allows reading the state of actions

Note that because all workflows remove all permissions at the top level the current default permissions don't take any effect.

Removes all default permissions, and only adds needed permissions to the
workflows that need it.

- read contents: allows reading the repository, most workflows need this
- write contents: allows to write to the repository. Needed to create releases
- write pull-requests: allows to manipulate pull requests. Unfortunately this
  is needed to comment on PRs
- read actions: allows reading the state of actions

Signed-off-by: Pau Ruiz Safont <[email protected]>
@psafont
Copy link
Member Author

psafont commented Feb 28, 2025

The normal PR workflows are working and uploading artificats as usual

@psafont
Copy link
Member Author

psafont commented Feb 28, 2025

What's missing to test: creating a release, deploy to pypi, push commits to docs repo. I think we'll have to bite the bullet here and act if they break with this change, although unlikely.

@psafont psafont marked this pull request as ready for review February 28, 2025 15:43
@psafont psafont added this pull request to the merge queue Mar 4, 2025
Merged via the queue into xapi-project:master with commit da73f08 Mar 4, 2025
15 checks passed
@psafont psafont deleted the ghperms branch March 5, 2025 09:54
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.

3 participants