Skip unsupported pull_request_review events in activation reaction/status conditions#33418
Merged
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Skip pull_request_review in reaction and status conditions
Skip unsupported May 20, 2026
pull_request_review events in activation reaction/status conditions
Copilot created this pull request from a session on behalf of
pelikhan
May 20, 2026 00:51
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents activation workflows from attempting reaction/status-comment behaviors on unsupported pull_request_review events by removing pull_request_review branches from the generated native and workflow_dispatch-source event conditions, and updating unit tests accordingly.
Changes:
- Removed
pull_request_reviewfrom reaction/status-comment condition generation (native event and centralizedworkflow_dispatchsource-event disjunction). - Preserved fork-guard semantics for supported
pull_requestactivation paths. - Updated/renamed expression builder tests to assert
pull_request_reviewis excluded while supported events remain included.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/expression_builder.go | Stops emitting pull_request_review branches in reaction/status-comment and workflow_dispatch source-event conditions. |
| pkg/workflow/expressions_test.go | Updates tests to assert pull_request_review is excluded and supported events remain present. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
| // pull_request_review events also populate github.event.pull_request.head.repo.id, so the | ||
| // same fork-guard expression works for both event types. | ||
| // For pull_request events, we need to ensure it's not from a forked repository since | ||
| // forked repositories have read-only permissions and cannot add reactions. |
Collaborator
|
@copilot review all comments, lint go |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done. I addressed the pending review feedback by clarifying the fork-guard comment in |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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.
Activation steps were attempting to add the eyes reaction and run-start comment on
pull_request_reviewevents. Those paths are unsupported byadd_reaction.cjs/add_workflow_run_comment.cjs, causing validation failures in workflows such asmattpocock-skills-reviewer.Condition builder change
/pkg/workflow/expression_builder.goso reaction/status-comment condition generation no longer emitspull_request_reviewbranches.pull_requestevents.Centralized dispatch parity
aw_context.event_type == 'pull_request_review'from the generatedworkflow_dispatchsource-event disjunction for these same activation paths.Behavioral test updates
/pkg/workflow/expressions_test.goto assert:pull_request_reviewis excluded for both reaction and status-comment conditions.issues, guardedpull_request,discussion) remain present.