fix: use pull_request_target for CodeRabbit review trigger (#1583)

The workflow was failing with 403 "Resource not accessible by integration"
on fork PRs because pull_request events get read-only GITHUB_TOKEN
permissions for cross-repository PRs. Switching to pull_request_target
runs the workflow in the base repo context, granting write permissions
needed to post the @coderabbitai review comment.

This is safe because the workflow only posts a comment and does not
check out or execute any code from the PR branch.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alex Verkhovsky 2026-02-07 09:27:57 -07:00 committed by GitHub
parent 045b1fe148
commit cb73c05cf6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
name: Trigger CodeRabbit on Ready for Review name: Trigger CodeRabbit on Ready for Review
on: on:
pull_request: pull_request_target:
types: [ready_for_review] types: [ready_for_review]
jobs: jobs: