fix: grant contents/pull-requests write to sync_actions reusable workflow call#20613
Merged
fix: grant contents/pull-requests write to sync_actions reusable workflow call#20613
Conversation
The sync_actions job calls a reusable workflow (sync-actions.yml) that
requires contents: write and pull-requests: write. Since the compiler
always writes permissions: {} at the top-level of lock files, the
calling job must explicitly grant the required permissions.
Adds permissions: contents: write, pull-requests: write to the
sync_actions job in release.md and recompiles release.lock.yml.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a permissions denial when the sync_actions job calls a reusable workflow (sync-actions.yml@main) that requires elevated token scopes.
Changes:
- Adds explicit job-level
permissions(contents: write,pull-requests: write) tosync_actionsin the source workflow markdown. - Recompiles the generated workflow so the permissions block is present in the
sync_actionsjob in the lockfile.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/release.md | Grants sync_actions the job-level write permissions required by the called reusable workflow. |
| .github/workflows/release.lock.yml | Regenerated output reflects the new sync_actions job permissions block. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
sync_actionsjob callssync-actions.yml@main, which internally declarescontents: write, pull-requests: write. The compiler always emitspermissions: {}at the workflow top-level, so without explicit job-level permissions on the calling job, the reusable workflow is denied those permissions.Changes
release.md: Addedpermissions: contents: write, pull-requests: writeto thesync_actionsjob definitionrelease.lock.yml: Recompiled — permissions now appear on thesync_actionsjob