fix: handle pull_request_review event in add_workflow_run_comment.cjs#44503
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
🤖 PR Triage
Score breakdown: Impact 40 · Urgency 22 · Quality 10 Targeted runtime fix — Triaged by PR Triage Agent · run §29001405167
|
|
❌ Test Quality Sentinel failed during test quality analysis. |
|
🔎 PR Code Quality Reviewer is reviewing code quality for this pull request... |
|
🧠 Matt Pocock Skills Reviewer failed during the skills-based review. |
There was a problem hiding this comment.
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_reviewtoEVENT_TYPE_DESCRIPTIONSso generated run-started messages label the event correctly. - Handle
pull_request_reviewincreateOrReuseStatusCommentby 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
|
🔍 Design Decision Gate 🏗️ is checking for design decision records on this pull request... |
|
🎉 This pull request is included in a new release. Release: |
PR #30354 widened the compile-time
if:gate for the "Add comment with workflow run link" step to includepull_request_review, but the runtime script's switch statement had no matching case — falling through toERR_VALIDATION. Workflows withstatus-comment: trueonpull_request_reviewnow fail activation entirely.Changes
add_workflow_run_comment.cjspull_request_review: "pull request review"toEVENT_TYPE_DESCRIPTIONScase "pull_request_review":to the switch increateOrReuseStatusComment, grouped withpull_request/pull_request_comment/pull_request_review_comment— all usepayload.pull_request.numberadd_workflow_run_comment.test.cjspull_request_review, mirroring the existingpull_request_review_commentblock