Fix workflow template permissions and surface 403 errors#1127
Open
ElliotJLT wants to merge 1 commit intoanthropics:mainfrom
Open
Fix workflow template permissions and surface 403 errors#1127ElliotJLT wants to merge 1 commit intoanthropics:mainfrom
ElliotJLT wants to merge 1 commit intoanthropics:mainfrom
Conversation
Two fixes for anthropics#1121: 1. Example workflows pr-review-filtered-authors.yml and pr-review-filtered-paths.yml had pull-requests: read instead of write, preventing Claude from posting review comments. 2. Permission errors (HTTP 403) from the GitHub API were silently swallowed. Now they throw a PermissionError with a clear message pointing users to the required workflow permissions.
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.
Summary
Fixes #1121. Two related bugs:
Wrong permissions in example workflows:
pr-review-filtered-authors.ymlandpr-review-filtered-paths.ymlhadpull-requests: readinstead ofwrite. Users copying these templates get silent failures when Claude tries to post review comments. The other example workflows already had the correctwritepermission.Silent 403 failures: When the GitHub API returns a 403 (permission denied), the error was caught and logged but the action exited successfully (code 0). Now throws a
PermissionErrorwith a clear message pointing users to the required workflow permissions. Also surfaces 403 help text in the MCP comment servers so Claude can self-diagnose the issue.Test plan
pr-review-filtered-authors.ymlinto a test repo — verify Claude can post review commentspull-requests: read— verify it fails with a clear permission error instead of exiting 0