Skip to content

Skip unsupported pull_request_review events in activation reaction/status conditions#33418

Merged
pelikhan merged 7 commits into
mainfrom
copilot/update-add-eyes-reaction-skip-events
May 20, 2026
Merged

Skip unsupported pull_request_review events in activation reaction/status conditions#33418
pelikhan merged 7 commits into
mainfrom
copilot/update-add-eyes-reaction-skip-events

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

Activation steps were attempting to add the eyes reaction and run-start comment on pull_request_review events. Those paths are unsupported by add_reaction.cjs / add_workflow_run_comment.cjs, causing validation failures in workflows such as mattpocock-skills-reviewer.

  • Condition builder change

    • Updated /pkg/workflow/expression_builder.go so reaction/status-comment condition generation no longer emits pull_request_review branches.
    • Kept existing fork-guard semantics for supported pull_request events.
  • Centralized dispatch parity

    • Removed aw_context.event_type == 'pull_request_review' from the generated workflow_dispatch source-event disjunction for these same activation paths.
  • Behavioral test updates

    • Updated /pkg/workflow/expressions_test.go to assert:
      • pull_request_review is excluded for both reaction and status-comment conditions.
      • supported events (issues, guarded pull_request, discussion) remain present.
    • Renamed/refined test cases for clearer intent.
if includePullRequests {
    terms = append(terms, BuildEventTypeEquals("pull_request_review_comment"))
    terms = append(terms, BuildEquals(eventExpr, BuildStringLiteral("pull_request")))
    // pull_request_review intentionally excluded
}

Copilot AI and others added 4 commits May 20, 2026 00:42
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 pull_request_review events in activation reaction/status conditions May 20, 2026
Copilot AI requested a review from pelikhan May 20, 2026 00:51
@pelikhan pelikhan marked this pull request as ready for review May 20, 2026 01:01
Copilot AI review requested due to automatic review settings May 20, 2026 01:01
Copy link
Copy Markdown
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 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_review from reaction/status-comment condition generation (native event and centralized workflow_dispatch source-event disjunction).
  • Preserved fork-guard semantics for supported pull_request activation paths.
  • Updated/renamed expression builder tests to assert pull_request_review is 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

Comment thread pkg/workflow/expression_builder.go Outdated
// 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.
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot review all comments, lint go

Copilot AI and others added 2 commits May 20, 2026 01:11
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 20, 2026

@copilot review all comments, lint go

Done. I addressed the pending review feedback by clarifying the fork-guard comment in pkg/workflow/expression_builder.go to cover both reactions and status-comments in commit 875f0ca, and re-ran Go lint (make golint) successfully.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan merged commit 35a32d2 into main May 20, 2026
@pelikhan pelikhan deleted the copilot/update-add-eyes-reaction-skip-events branch May 20, 2026 01:20
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.

3 participants