Problem
create_pull_request_review_comment and submit_pull_request_review safe outputs fail when the workflow is triggered via workflow_dispatch, even when the agent correctly identifies the PR number from inputs.pr_number.
Error messages
Target is "triggering" but not running in pull request context, skipping review comment creation
✗ Message 1 (create_pull_request_review_comment) failed: Not in pull request context
Setting review metadata: event=COMMENT, bodyLength=2612
✓ Message 4 (submit_pull_request_review) completed successfully
No review context set - cannot submit review
✗ Failed to submit PR review: No review context available
Why this matters
workflow_dispatch is a common way to test review workflows before merging them to main (using --ref <branch>). It's also useful for re-reviewing specific PRs on demand. The safe-outputs handler has the pr_number input available but doesn't resolve it into PR review context.
Current workaround
Use add_comment with target: "*" instead — this works from all trigger types but produces regular comments, not inline review annotations.
Additional context
pull_request and issue_comment triggers work correctly (they have github.event.pull_request context)
- Safe outputs are fire-and-forget from the agent's perspective — the agent cannot detect failures and fall back to
add_comment
- This makes try-then-fallback patterns impossible
Expected
The safe-outputs handler should resolve inputs.pr_number (or a configurable target field) into PR context for review-related safe outputs, similar to how add_comment supports target: "*".
Discovered in
Problem
create_pull_request_review_commentandsubmit_pull_request_reviewsafe outputs fail when the workflow is triggered viaworkflow_dispatch, even when the agent correctly identifies the PR number frominputs.pr_number.Error messages
Why this matters
workflow_dispatchis a common way to test review workflows before merging them to main (using--ref <branch>). It's also useful for re-reviewing specific PRs on demand. The safe-outputs handler has thepr_numberinput available but doesn't resolve it into PR review context.Current workaround
Use
add_commentwithtarget: "*"instead — this works from all trigger types but produces regular comments, not inline review annotations.Additional context
pull_requestandissue_commenttriggers work correctly (they havegithub.event.pull_requestcontext)add_commentExpected
The safe-outputs handler should resolve
inputs.pr_number(or a configurabletargetfield) into PR context for review-related safe outputs, similar to howadd_commentsupportstarget: "*".Discovered in