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

Fix Permissions on Publish Release Artifacts Job #3511

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/publish-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ permissions: read-all
jobs:
publish-release-artifacts:
permissions:
contents: read # to fetch code (actions/checkout)
actions: write # to attach binaries to release artifacts (skx/github-action-publish-binaries)
contents: write # to fetch code and upload artifacts
Copy link
Contributor

Choose a reason for hiding this comment

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

It's more a question at this point,
I'm just curious to notice that
a local permission setting contents: write within publish-release-artifacts
seems to overwrite, or at least give more rights than the global permissions: read-all just above.

I was wondering if this would allow an included script or action to sneakily "update" permissions in its own code even when permissions are set to read-all at the beginning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe not--I believe the included action can't modify the job's permission.

A PR could change the permissions though. Supposedly we are protected from that though, as PRs from (first-time?) contributors require approval before actions are run. So we can inspect to make sure they aren't messing with the action definitions.


runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
Expand Down