Skip to content

Comments

Fix submit_pull_request_review when not in pull_request trigger (fixes #16587)#16602

Merged
pelikhan merged 6 commits intogithub:mainfrom
strawgate:submit-review-without-pr-context
Feb 18, 2026
Merged

Fix submit_pull_request_review when not in pull_request trigger (fixes #16587)#16602
pelikhan merged 6 commits intogithub:mainfrom
strawgate:submit-review-without-pr-context

Conversation

@strawgate
Copy link
Contributor

Adds target to submit-pull-request-review (same semantics as add-comment). When the workflow isn't triggered by a PR (e.g. workflow_dispatch), set target to the PR number so the handler can resolve and set review context before finalization.

Fixes #16587

Copilot AI review requested due to automatic review settings February 18, 2026 16:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #16587 where submit_pull_request_review would lose review context during finalization when workflows are not triggered by a pull request event (e.g., workflow_dispatch). The fix adds a target field to the submit-pull-request-review safe output configuration, following the same semantics as add-comment.

Changes:

  • Added target configuration field to submit-pull-request-review handler with support for "triggering" (default), "*" (use pull_request_number from message), or explicit PR number
  • Implemented target resolution logic using the shared resolveTarget helper function to fetch PR context when needed
  • Updated validation, documentation, and added comprehensive test coverage for the new functionality

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/workflow/submit_pr_review.go Adds Target field to SubmitPullRequestReviewConfig struct with YAML parsing
pkg/workflow/safe_outputs_target_validation.go Includes submit-pull-request-review in target validation
pkg/workflow/compiler_safe_outputs_config.go Adds target to handler config JSON via AddIfNotEmpty
pkg/workflow/submit_pr_review_footer_test.go Adds tests for target field parsing and handler config inclusion
actions/setup/js/submit_pr_review.cjs Implements target resolution using resolveTarget helper, fetches PR when needed
actions/setup/js/submit_pr_review.test.cjs Adds tests for target scenarios (explicit number, "*", triggering, non-PR context)
docs/src/content/docs/reference/safe-outputs.md Documents the new target field with usage examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pelikhan
Copy link
Contributor

Update the spec as well.

@strawgate
Copy link
Contributor Author

done

@pelikhan pelikhan merged commit cbf6634 into github:main Feb 18, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

submit_pull_request_review safe output: review context lost during finalization — review never submitted

2 participants