Skip to content

fix: handle pull_request_review event in add_workflow_run_comment.cjs#44503

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-pull-request-review-trigger
Jul 9, 2026
Merged

fix: handle pull_request_review event in add_workflow_run_comment.cjs#44503
pelikhan merged 2 commits into
mainfrom
copilot/fix-pull-request-review-trigger

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

PR #30354 widened the compile-time if: gate for the "Add comment with workflow run link" step to include pull_request_review, but the runtime script's switch statement had no matching case — falling through to ERR_VALIDATION. Workflows with status-comment: true on pull_request_review now fail activation entirely.

Changes

  • add_workflow_run_comment.cjs

    • Added pull_request_review: "pull request review" to EVENT_TYPE_DESCRIPTIONS
    • Added case "pull_request_review": to the switch in createOrReuseStatusComment, grouped with pull_request / pull_request_comment / pull_request_review_comment — all use payload.pull_request.number
  • add_workflow_run_comment.test.cjs

    • Added happy-path and missing-PR-number tests for pull_request_review, mirroring the existing pull_request_review_comment block

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix pull request review trigger activation error fix: handle pull_request_review event in add_workflow_run_comment.cjs Jul 9, 2026
Copilot AI requested a review from pelikhan July 9, 2026 05:48
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Field Value
Category bug
Risk 🟢 Low
Score 72 / 100
Action fast_track

Score breakdown: Impact 40 · Urgency 22 · Quality 10

Targeted runtime fix — pull_request_review event falls through to ERR_VALIDATION in add_workflow_run_comment.cjs. 2 files, 40 lines, CI passing. Remove DRAFT and fast-track for human review.

Triaged by PR Triage Agent · run §29001405167

Generated by 🔧 PR Triage Agent · 194.4 AIC · ⌖ 6.64 AIC · ⊞ 5.4K ·

@pelikhan pelikhan marked this pull request as ready for review July 9, 2026 10:54
Copilot AI review requested due to automatic review settings July 9, 2026 10:54
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel failed during test quality analysis.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🔎 PR Code Quality Reviewer is reviewing code quality for this pull request...

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer failed during the skills-based review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes workflow activation failures when status-comment: true workflows run on the pull_request_review event by adding missing runtime handling in the add_workflow_run_comment action script, plus targeted tests to prevent regressions.

Changes:

  • Add pull_request_review to EVENT_TYPE_DESCRIPTIONS so generated run-started messages label the event correctly.
  • Handle pull_request_review in createOrReuseStatusComment by routing it through the same PR-comment endpoint logic as other PR-scoped events.
  • Add happy-path and missing-PR-number test coverage for pull_request_review.
Show a summary per file
File Description
actions/setup/js/add_workflow_run_comment.cjs Adds pull_request_review support to the event description map and the status-comment routing switch so the action no longer fails validation for that event.
actions/setup/js/add_workflow_run_comment.test.cjs Adds regression tests covering successful comment creation and the expected failure when the PR number is absent for pull_request_review.

Review details

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Low

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🔍 Design Decision Gate 🏗️ is checking for design decision records on this pull request...

@pelikhan pelikhan merged commit d6b937b into main Jul 9, 2026
58 of 68 checks passed
@pelikhan pelikhan deleted the copilot/fix-pull-request-review-trigger branch July 9, 2026 11:54
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.8

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.

pull_request_review trigger fails activation: ERR_VALIDATION in add_workflow_run_comment.cjs (regression from #30354)

3 participants