Fix submit_pull_request_review when not in pull_request trigger (fixes #16587)#16602
Merged
pelikhan merged 6 commits intogithub:mainfrom Feb 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
targetconfiguration field tosubmit-pull-request-reviewhandler with support for "triggering" (default), "*" (use pull_request_number from message), or explicit PR number - Implemented target resolution logic using the shared
resolveTargethelper 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.
Contributor
|
Update the spec as well. |
Contributor
Author
|
done |
pelikhan
reviewed
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
targettosubmit-pull-request-review(same semantics as add-comment). When the workflow isn't triggered by a PR (e.g.workflow_dispatch), settargetto the PR number so the handler can resolve and set review context before finalization.Fixes #16587