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

Conversation

felixhandte
Copy link
Contributor

Publishing release artifacts requires the contents permission, as documented by: https://docs.github.com/en/rest/overview/permissions-required-for-github-apps.

Tested by authoring a release on my fork.

Publishing release artifacts requires the `contents` permission, as documented
by: https://docs.github.com/en/rest/overview/permissions-required-for-github-apps.
@felixhandte felixhandte merged commit 3c50854 into facebook:dev Feb 15, 2023
@@ -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.

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

Successfully merging this pull request may close these issues.

3 participants