From 47649c0e67b7b19af3e24435330a40f91206ce06 Mon Sep 17 00:00:00 2001 From: Inuka Wijerathna Date: Sun, 5 Jul 2026 23:33:16 +0530 Subject: [PATCH] ci: skip PR comment step when workflow_run has no pull request leave-comment.yml runs after "Generate and Compare Docs", which triggers on both push (to main) and pull_request. Push-triggered runs have no associated PR, so github.event.workflow_run.pull_requests[0] is undefined and the comment step fails with "No issue/pull request in input neither in current context." Guard the job so it only runs when the triggering workflow_run was itself started by a pull_request event. Refs: https://github.com/nodejs/doc-kit/actions/runs/28747289633/job/85240250539 --- .github/workflows/leave-comment.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/leave-comment.yml b/.github/workflows/leave-comment.yml index 8b4f2a1a..18c22035 100644 --- a/.github/workflows/leave-comment.yml +++ b/.github/workflows/leave-comment.yml @@ -13,6 +13,10 @@ permissions: jobs: aggregate: name: Aggregate Comparison Results + # Only pull_request-triggered runs have a PR to comment on; runs triggered + # by a plain push to main (e.g. after a merge) have none, and attempting + # to comment in that case fails with "No issue/pull request in input". + if: github.event.workflow_run.event == 'pull_request' runs-on: ubuntu-latest steps: - name: Harden Runner