Reduce workflow permissions to match lock file requirements#266
Merged
Reduce workflow permissions to match lock file requirements#266
Conversation
- Remove discussions: write from pr-checks-fix, pr-ci-detective, pr-ci-fixer (both trigger and example files) where lock files don't require it - Downgrade pull-requests: write to pull-requests: read in duplicate-issue-detector and pr-ci-detective (both trigger and example files) where lock files only need read access - Remove outdated github/gh-aw#16673 comments from all files Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove unnecessary permissions from workflows
Reduce workflow permissions to match lock file requirements
Feb 21, 2026
strawgate
reviewed
Feb 21, 2026
| discussions: write | ||
| issues: write | ||
| pull-requests: write # required by gh-aw compiler for add-comment (github/gh-aw#16673) | ||
| pull-requests: write |
Contributor
Author
There was a problem hiding this comment.
Changed to pull-requests: read in both the example and trigger file in fe1c46f.
strawgate
reviewed
Feb 21, 2026
| contents: write | ||
| discussions: write | ||
| issues: write | ||
| pull-requests: write |
Collaborator
There was a problem hiding this comment.
pull-requests: read
as we're just leaving a comment
Contributor
Author
There was a problem hiding this comment.
Changed to pull-requests: read in both the example and trigger file in fe1c46f.
strawgate
reviewed
Feb 21, 2026
| discussions: write | ||
| issues: write | ||
| pull-requests: write # required by gh-aw compiler for add-comment (github/gh-aw#16673) | ||
| pull-requests: write |
Collaborator
There was a problem hiding this comment.
should be read as we're just leaving a comment
Contributor
Author
There was a problem hiding this comment.
Changed to pull-requests: read in both the example and trigger file in fe1c46f.
Collaborator
|
@copilot address PR Feedback |
…, pr-ci-fixer Comments are posted via COPILOT_GITHUB_TOKEN so only pull-requests: read is needed for the workflow token in these workflows. Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
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.
discussions: writeandpull-requests: writewere added to several workflows as a workaround for a gh-aw compiler issue (github/gh-aw#16673). With the new compiler version these are no longer needed — the regenerated lock files reflect actual requirements.Changes
Compared every trigger/example file's granted permissions against the union of job-level permissions in the corresponding
.lock.yml:discussions: writefrompr-checks-fix,pr-ci-detective,pr-ci-fixer(trigger + example)pull-requests: write→readinduplicate-issue-detector,pr-ci-detective,issue-triage,pr-checks-fix,pr-ci-fixer(trigger + example) — comments are posted viaCOPILOT_GITHUB_TOKENso only read access is needed for the workflow token# required by gh-aw compiler for add-comment (github/gh-aw#16673)comments from all filesKept (verified needed per lock files)
discussions: writeandpull-requests: writeare retained where lock files actually declare them in job-level permissions and the workflow token genuinely needs write access: issue-triage-pr, mention-in-issue, mention-in-pr.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.