-
Notifications
You must be signed in to change notification settings - Fork 295
Description
Problem
In cross-repository review flows, submit_pull_request_review appears to resolve the repository from the provider workflow context instead of the consumer repository. This causes PR review submission to hit the wrong repo and fail with 404.
Observed behavior
- Request was sent to:
POST /repos/provider-org/provider-repo/pulls/1/reviews - Failure:
Failed to submit PR review: Not Found
Expected behavior
submit_pull_request_review should support an optional target-repo parameter (same pattern already used by add_comment and create_pull_request_review_comment).
- If target-repo is provided: use it for repo resolution.
- If omitted: fallback to github.repository for backward compatibility.
Why this is a bug in cross-repo scenarios
In the same run, safe output config already supports target-repo for:
- add_comment
- create_pull_request_review_comment
But submit_pull_request_review currently receives only target (PR number), so review submission is routed to the provider repo instead of the consumer repo.
Minimal scenario
- Provider repo: provider-org/provider-repo
- Consumer repo (actual PR repo): consumer-org/consumer-repo
- PR number: 1
- submit_pull_request_review tries provider repo endpoint and returns 404
Suggested fix
- Add optional target-repo support to submit_pull_request_review in safe outputs handler config.
- Keep backward-compatible fallback to github.repository when target-repo is missing.
- Add tests for cross-repo PR review submission.
- Update docs/examples to match behavior parity with existing safe-output tools.
Impact
This blocks reliable cross-repo approval/review submission even when comment tools are correctly configured for the consumer repository.