Repository navigation
Add target field support to create-pull-request-review-comment - #1143
Merged
Merged
Conversation
Co-authored-by: pelikhan <[email protected]>
…omment Co-authored-by: pelikhan <[email protected]>
Co-authored-by: pelikhan <[email protected]>
Copilot
AI
changed the title
[WIP] create-pull-request-review-comment not supporting target
Add target field support to create-pull-request-review-comment
Oct 2, 2025
pelikhan
marked this pull request as ready for review
October 2, 2025 02:53
Collaborator
|
/tidy |
Collaborator
|
@copilot format, lint, fix tests |
Contributor
Author
Completed. Ran
Completed. All formatting, linting, and tests pass successfully:
No code changes were needed as everything is already properly formatted and all tests are passing. |
pelikhan
approved these changes
Oct 2, 2025
pelikhan
enabled auto-merge (squash)
October 2, 2025 03:45
pelikhan
disabled auto-merge
October 2, 2025 03:49
pelikhan
enabled auto-merge (squash)
October 2, 2025 03:49
pelikhan
disabled auto-merge
October 2, 2025 03:49
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.
Overview
This PR adds
targetfield support to thecreate-pull-request-review-commentsafe output configuration, bringing it to feature parity withadd-comment. This allows workflows to create PR review comments on any pull request, not just the triggering one.Changes
New
targetConfiguration FieldThe
create-pull-request-review-commentsafe output now supports atargetfield with three modes:Default behavior (
target: "triggering"or omitted):Only creates review comments on the triggering pull request (existing behavior preserved).
Any PR (
target: "*"):Allows commenting on any PR by including
pull_request_numberin the agent output. Useful for workflows that analyze multiple PRs.Specific PR (
target: <number>):Always comments on the specified PR number, regardless of the triggering event.
Implementation Details
Targetfield toCreatePullRequestReviewCommentsConfig, updated parsing and job generation logicJob Condition Optimization
When a
targetis explicitly specified, the generated job no longer includes unnecessary event context checks, allowing the workflow to run in more scenarios while maintaining security.Testing
All existing tests pass, and new tests cover:
Fixes #[issue_number]
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.