Skip to content

Fix workflow template permissions and surface 403 errors#1127

Open
ElliotJLT wants to merge 1 commit intoanthropics:mainfrom
ElliotJLT:fix/workflow-permissions-1121
Open

Fix workflow template permissions and surface 403 errors#1127
ElliotJLT wants to merge 1 commit intoanthropics:mainfrom
ElliotJLT:fix/workflow-permissions-1121

Conversation

@ElliotJLT
Copy link
Copy Markdown

Summary

Fixes #1121. Two related bugs:

  • Wrong permissions in example workflows: pr-review-filtered-authors.yml and pr-review-filtered-paths.yml had pull-requests: read instead of write. Users copying these templates get silent failures when Claude tries to post review comments. The other example workflows already had the correct write permission.

  • 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 PermissionError with 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

  • Copy pr-review-filtered-authors.yml into a test repo — verify Claude can post review comments
  • Run action with pull-requests: read — verify it fails with a clear permission error instead of exiting 0
  • Verify other example workflows are unaffected

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

claude-code-review workflow template generates insufficient permissions; action silently swallows write failure

1 participant