From b860ffa74b2c835f4e4c3adf9d544875493fdf62 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Sat, 7 Nov 2026 13:38:30 -0500 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B=20fix(ci):=20pr-verifier=20re-?= =?UTF-8?q?runs=20on=20label=20events=20so=20bot-pushed=20heads=20satisfy?= =?UTF-8?q?=20'verify=20PR=20contents'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com> --- .github/scripts/test-native-queue-workflows.py | 4 ++++ .github/workflows/changelog-fragment-guard.yml | 3 +++ .github/workflows/pr-verifier.yml | 11 ++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/scripts/test-native-queue-workflows.py b/.github/scripts/test-native-queue-workflows.py index e598728df9..2fd7087dc2 100644 --- a/.github/scripts/test-native-queue-workflows.py +++ b/.github/scripts/test-native-queue-workflows.py @@ -97,6 +97,10 @@ def test_dependabot_runs_the_same_trusted_pr_verifier(self): verifier = workflow("pr-verifier.yml") events = verifier.get("on", verifier.get(True)) self.assertIn("opened", events["pull_request_target"]["types"]) + # Bot token pushes fire no pull_request_target event; label flips must + # re-run the required context on the current head (#17036). + for action in ("synchronize", "ready_for_review", "labeled", "unlabeled"): + self.assertIn(action, events["pull_request_target"]["types"]) job = verifier["jobs"]["verify"] self.assertNotIn("if", job) self.assertEqual(job["name"], "verify PR contents") diff --git a/.github/workflows/changelog-fragment-guard.yml b/.github/workflows/changelog-fragment-guard.yml index 2bb7522185..0414437f21 100644 --- a/.github/workflows/changelog-fragment-guard.yml +++ b/.github/workflows/changelog-fragment-guard.yml @@ -240,6 +240,9 @@ jobs: Signed-off-by: ${PR_AUTHOR_LOGIN} <${author_email}>" # --force-with-lease against the SHA this run evaluated: never # clobber a push the author made while this job ran. + # This token push does not fire `pull_request_target` workflows, so + # pr-verifier (a required context) relies on its labeled/unlabeled + # types to catch up on the new head (#17036). if git push --force-with-lease="refs/heads/${HEAD_REF}:${HEAD_SHA}" origin "HEAD:refs/heads/${HEAD_REF}"; then echo "pushed=true" >> "$GITHUB_OUTPUT" echo "fragment=$f" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/pr-verifier.yml b/.github/workflows/pr-verifier.yml index 4bc1fc4c2a..6df3c4eab6 100644 --- a/.github/workflows/pr-verifier.yml +++ b/.github/workflows/pr-verifier.yml @@ -1,8 +1,17 @@ name: PR Verifier +# REQUIRED CONTEXT on v5: `verify PR contents` must report on the final head +# of every PR. A push made with the workflow token (e.g. changelog-fragment- +# guard's autofix, or any other github.token push) fires `pull_request` +# workflows but NOT `pull_request_target` ones, so without help this context +# stays "expected" forever and the PR is BLOCKED (#16567, #17036). +# `labeled`/`unlabeled` (and `ready_for_review`) are listed, mirroring +# native-queue-policy.yml, so the prow/hive label flips that follow a bot push +# (made with App tokens, which do fire this event) re-run the verifier on the +# current head. The concurrency group below bounds the cost. on: pull_request_target: - types: [opened, edited, synchronize, reopened] + types: [opened, edited, synchronize, reopened, ready_for_review, labeled, unlabeled] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} From 3b815efe17fd344749b99c3457a5d3b3c97ec017 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Sat, 7 Nov 2026 18:25:00 -0500 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=9B=20fix(ci):=20header=20comments?= =?UTF-8?q?=20attribute=20the=20autofix=20push=20to=20the=20PAT,=20not=20g?= =?UTF-8?q?ithub.token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review on #17048 noted the pr-verifier and changelog-fragment-guard comments said the autofix push used the workflow token; the guard's checkout uses TOPUP_PUSH_TOKEN when set and the observed pull_request runs on #16567 were PAT-triggered. Wording only; no trigger or permission change. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .github/workflows/changelog-fragment-guard.yml | 7 ++++--- .github/workflows/pr-verifier.yml | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/changelog-fragment-guard.yml b/.github/workflows/changelog-fragment-guard.yml index 0414437f21..274f57a5db 100644 --- a/.github/workflows/changelog-fragment-guard.yml +++ b/.github/workflows/changelog-fragment-guard.yml @@ -240,9 +240,10 @@ jobs: Signed-off-by: ${PR_AUTHOR_LOGIN} <${author_email}>" # --force-with-lease against the SHA this run evaluated: never # clobber a push the author made while this job ran. - # This token push does not fire `pull_request_target` workflows, so - # pr-verifier (a required context) relies on its labeled/unlabeled - # types to catch up on the new head (#17036). + # Neither the TOPUP_PUSH_TOKEN push (fires `pull_request` only) nor + # a github.token push (fires nothing) triggers `pull_request_target` + # workflows, so pr-verifier (a required context) relies on its + # labeled/unlabeled types to catch up on the new head (#17036). if git push --force-with-lease="refs/heads/${HEAD_REF}:${HEAD_SHA}" origin "HEAD:refs/heads/${HEAD_REF}"; then echo "pushed=true" >> "$GITHUB_OUTPUT" echo "fragment=$f" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/pr-verifier.yml b/.github/workflows/pr-verifier.yml index 6df3c4eab6..9a5d9d32e1 100644 --- a/.github/workflows/pr-verifier.yml +++ b/.github/workflows/pr-verifier.yml @@ -1,10 +1,11 @@ name: PR Verifier # REQUIRED CONTEXT on v5: `verify PR contents` must report on the final head -# of every PR. A push made with the workflow token (e.g. changelog-fragment- -# guard's autofix, or any other github.token push) fires `pull_request` -# workflows but NOT `pull_request_target` ones, so without help this context -# stays "expected" forever and the PR is BLOCKED (#16567, #17036). +# of every PR. changelog-fragment-guard's autofix push (made with the +# TOPUP_PUSH_TOKEN PAT) fired `pull_request` workflows but NOT +# `pull_request_target` ones on #16567, and a plain github.token push fires +# nothing at all, so without help this context stays "expected" forever and +# the PR is BLOCKED (#16567, #17036). # `labeled`/`unlabeled` (and `ready_for_review`) are listed, mirroring # native-queue-policy.yml, so the prow/hive label flips that follow a bot push # (made with App tokens, which do fire this event) re-run the verifier on the From 53f22a315f8a4e9881198ec42c4b798b2e1e69e7 Mon Sep 17 00:00:00 2001 From: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Sat, 7 Nov 2026 18:48:17 -0500 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=90=9B=20fix(ci):=20dispatch=20pr-ver?= =?UTF-8?q?ifier=20after=20a=20github.token=20autofix=20push=20so=20the=20?= =?UTF-8?q?required=20context=20lands=20on=20the=20new=20head?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review on #17048 showed the labeled/unlabeled types alone have no producer: on #16567 the autofix push b9cd4bac landed 47s after the last prow label and no label event followed for three days. It also showed the earlier header comment was wrong about which token pushed — every run on that head reports actor=github-actions[bot], i.e. github.token (Dependabot-triggered runs see no Actions secrets), and that push did fire the pull_request workflows. A PAT/App push already fires pull_request_target, so the gap is specific to github.token pushes, and a github.token label flip fires nothing either. The only events github.token may trigger are workflow_dispatch and repository_dispatch, so: - pr-verifier.yml: add workflow_dispatch(pr_number); a dispatched run rebuilds the pull_request payload from the API, refuses fork PRs, and reports nothing when the PR head is no longer the ref tip. - changelog-fragment-guard.yml: after pushed=true, when TOPUP_PUSH_TOKEN is unset, dispatch pr-verifier.yml on the PR branch (same-repo only) so the check lands on the pushed head; actions: write for the dispatch. - Header comments now state the verified facts instead of the PAT claim. - test-native-queue-workflows.py covers the dispatch contract end to end. Hive-Fix-Attempt: 2/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .../scripts/test-native-queue-workflows.py | 40 +++++++++- .../workflows/changelog-fragment-guard.yml | 58 +++++++++++--- .github/workflows/pr-verifier.yml | 80 ++++++++++++++++--- 3 files changed, 154 insertions(+), 24 deletions(-) diff --git a/.github/scripts/test-native-queue-workflows.py b/.github/scripts/test-native-queue-workflows.py index 2fd7087dc2..30890e6ad2 100644 --- a/.github/scripts/test-native-queue-workflows.py +++ b/.github/scripts/test-native-queue-workflows.py @@ -97,8 +97,8 @@ def test_dependabot_runs_the_same_trusted_pr_verifier(self): verifier = workflow("pr-verifier.yml") events = verifier.get("on", verifier.get(True)) self.assertIn("opened", events["pull_request_target"]["types"]) - # Bot token pushes fire no pull_request_target event; label flips must - # re-run the required context on the current head (#17036). + # A github.token push fires no pull_request_target event; App/PAT label + # flips must re-run the required context on the current head (#17036). for action in ("synchronize", "ready_for_review", "labeled", "unlabeled"): self.assertIn(action, events["pull_request_target"]["types"]) job = verifier["jobs"]["verify"] @@ -108,6 +108,42 @@ def test_dependabot_runs_the_same_trusted_pr_verifier(self): if step.get("name") == "Verifier action") self.assertIn("docker run --rm", verify_step["run"]) + def test_autofix_push_deterministically_redispatches_the_verifier(self): + # #16567: the autofix push landed after the last prow label and no + # label event followed for three days, so labeled/unlabeled alone has + # no producer. workflow_dispatch is one of the two events a + # github.token may trigger; the guard dispatches pr-verifier on the + # PR branch so the check lands on the pushed head (#17036). + verifier = workflow("pr-verifier.yml") + events = verifier.get("on", verifier.get(True)) + self.assertIn("pr_number", events["workflow_dispatch"]["inputs"]) + self.assertTrue(events["workflow_dispatch"]["inputs"]["pr_number"]["required"]) + self.assertIn("inputs.pr_number", verifier["concurrency"]["group"]) + steps = verifier["jobs"]["verify"]["steps"] + hydrate = next(s for s in steps if s.get("id") == "dispatch_event") + self.assertEqual(hydrate["if"], "github.event_name == 'workflow_dispatch'") + # Never verify a fork's PR or a commit that is no longer the PR head. + self.assertIn("only same-repo PRs may be dispatched", hydrate["run"]) + self.assertIn('echo "stale=true"', hydrate["run"]) + verify_step = next(s for s in steps if s.get("id") == "verifier") + self.assertIn("steps.dispatch_event.outputs.stale != 'true'", verify_step["if"]) + self.assertIn("steps.dispatch_event.outputs.event_path", verify_step["env"]["VERIFIER_EVENT_PATH"]) + self.assertIn('-v "$VERIFIER_EVENT_PATH:/github/event.json:ro"', verify_step["run"]) + + guard = workflow("changelog-fragment-guard.yml") + self.assertEqual(guard["permissions"]["actions"], "write") + gsteps = guard["jobs"]["changelog-fragment-guard"]["steps"] + autofix = next(s for s in gsteps if s.get("id") == "autofix") + dispatch = next(s for s in gsteps if "Dispatch pr-verifier" in s.get("name", "")) + self.assertLess(gsteps.index(autofix), gsteps.index(dispatch)) + self.assertIn("steps.autofix.outputs.pushed == 'true'", dispatch["if"]) + # A PAT push already fires pull_request_target: dispatch only on the + # github.token path, and dispatch the PR branch so the check lands on + # the pushed head. + self.assertEqual(dispatch["env"]["HAS_PUSH_TOKEN"], "${{ secrets.TOPUP_PUSH_TOKEN != '' }}") + self.assertIn('[ "$HAS_PUSH_TOKEN" = "true" ]', dispatch["run"]) + self.assertIn('gh workflow run pr-verifier.yml --repo "$GITHUB_REPOSITORY" --ref "$HEAD_REF" -f "pr_number=${PR_NUMBER}"', dispatch["run"]) + def test_gosec_concurrency_fits_the_runner_cpu_limit(self): # gosec defaults -concurrency to runtime.NumCPU(), which inside a # runner pod is the NODE's vCPU count, not the pod's cgroup limit. diff --git a/.github/workflows/changelog-fragment-guard.yml b/.github/workflows/changelog-fragment-guard.yml index 274f57a5db..3b5319af7e 100644 --- a/.github/workflows/changelog-fragment-guard.yml +++ b/.github/workflows/changelog-fragment-guard.yml @@ -58,8 +58,12 @@ permissions: # same-repo PR branches; pull-requests: write posts the sticky guidance # comment. Both are read-only on fork PRs and those steps are skipped there. # No PR code is executed in this workflow — only git, grep and echo run. + # actions: write lets the autofix dispatch pr-verifier.yml on the head it + # pushed with github.token, the one event shape that token may fire + # (#17036). contents: write pull-requests: write + actions: write # Only a new push may cancel a running guard: the superseded run is on the # old head SHA, where nothing merges anyway. Label events must NOT cancel — @@ -117,11 +121,16 @@ jobs: # Full history so the merge base with the target branch exists # locally and the three-dot diff below is computable. fetch-depth: 0 - # The autofix push uses TOPUP_PUSH_TOKEN when set (a push made with - # that PAT re-runs the PR checks, so the guard goes green on its - # own); with GITHUB_TOKEN the push lands but does not trigger new - # runs — the next push or a maintainer re-run picks it up. Same - # optional-PAT convention as cli-pin-bump.yml / v5-topup.yml. + # The autofix push uses TOPUP_PUSH_TOKEN when set: a push made with + # that PAT fires `pull_request` AND `pull_request_target` runs, so + # every check re-reports on the new head. With github.token the + # push lands and fires the `pull_request` runs, but NO + # `pull_request_target` run (observed on #16567's b9cd4bac: eleven + # pull_request runs with actor=github-actions[bot], no PR Verifier). + # Dependabot-triggered runs see no Actions secrets, so Dependabot PRs + # (#16567) always take the github.token path; the dispatch step + # after the push re-runs pr-verifier for them. Same optional-PAT + # convention as cli-pin-bump.yml / v5-topup.yml / notice-autofix.yml. token: ${{ secrets.TOPUP_PUSH_TOKEN != '' && secrets.TOPUP_PUSH_TOKEN || github.token }} - name: Code changes must carry a changelog.d fragment (or no-changelog) @@ -240,10 +249,9 @@ jobs: Signed-off-by: ${PR_AUTHOR_LOGIN} <${author_email}>" # --force-with-lease against the SHA this run evaluated: never # clobber a push the author made while this job ran. - # Neither the TOPUP_PUSH_TOKEN push (fires `pull_request` only) nor - # a github.token push (fires nothing) triggers `pull_request_target` - # workflows, so pr-verifier (a required context) relies on its - # labeled/unlabeled types to catch up on the new head (#17036). + # When this push was made with github.token it fires no + # `pull_request_target` run, so pr-verifier (a required context) + # would stay "expected"; the step below re-triggers it (#17036). if git push --force-with-lease="refs/heads/${HEAD_REF}:${HEAD_SHA}" origin "HEAD:refs/heads/${HEAD_REF}"; then echo "pushed=true" >> "$GITHUB_OUTPUT" echo "fragment=$f" >> "$GITHUB_OUTPUT" @@ -251,6 +259,38 @@ jobs: echo "::warning::could not push the generated fragment (branch moved or token lacks push); leaving guidance comment instead" fi + # Deterministically re-run pr-verifier on the head just pushed (#17036). + # On #16567 the autofix push landed 47s after the last prow label and + # nothing relabelled the PR for three days, so pr-verifier's new + # labeled/unlabeled types alone had no producer. When the push used + # TOPUP_PUSH_TOKEN it already fired `pull_request_target` and nothing + # more is needed. When it used github.token, the only events that token + # may trigger are workflow_dispatch and repository_dispatch, so dispatch + # pr-verifier.yml on the PR branch: the run's check lands on the branch + # tip, which is the head just pushed. The autofix only pushes to + # same-repo branches, so this never dispatches a fork's workflow file. + - name: Dispatch pr-verifier on the autofix head (github.token push) + if: ${{ steps.autofix.outputs.pushed == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + HAS_PUSH_TOKEN: ${{ secrets.TOPUP_PUSH_TOKEN != '' }} + PR_NUMBER: ${{ github.event.pull_request.number }} + HEAD_REF: ${{ github.event.pull_request.head.ref }} + run: | + set -euo pipefail + if [ "$HAS_PUSH_TOKEN" = "true" ]; then + echo "Pushed with TOPUP_PUSH_TOKEN — the push itself fired pull_request_target; nothing to dispatch." + exit 0 + fi + if gh workflow run pr-verifier.yml --repo "$GITHUB_REPOSITORY" --ref "$HEAD_REF" -f "pr_number=${PR_NUMBER}"; then + echo "dispatched pr-verifier.yml on ${HEAD_REF} for #${PR_NUMBER}" + else + # Most likely the branch's pr-verifier.yml predates the + # workflow_dispatch trigger (HTTP 422): a rebase onto the base + # branch fixes it, and the rebase push fires everything anyway. + echo "::warning::could not dispatch pr-verifier.yml on ${HEAD_REF}; the required 'verify PR contents' context stays expected on the new head until a push, a non-github.token label flip, or a close/reopen (#17036). Rebasing onto the base branch resolves it." + fi + # Whatever the autofix did, tell the author once (one sticky comment, # updated in place) and remove the comment when the check passes. - name: Post or update guidance comment diff --git a/.github/workflows/pr-verifier.yml b/.github/workflows/pr-verifier.yml index 9a5d9d32e1..893dcb6979 100644 --- a/.github/workflows/pr-verifier.yml +++ b/.github/workflows/pr-verifier.yml @@ -1,21 +1,37 @@ name: PR Verifier # REQUIRED CONTEXT on v5: `verify PR contents` must report on the final head -# of every PR. changelog-fragment-guard's autofix push (made with the -# TOPUP_PUSH_TOKEN PAT) fired `pull_request` workflows but NOT -# `pull_request_target` ones on #16567, and a plain github.token push fires -# nothing at all, so without help this context stays "expected" forever and -# the PR is BLOCKED (#16567, #17036). -# `labeled`/`unlabeled` (and `ready_for_review`) are listed, mirroring -# native-queue-policy.yml, so the prow/hive label flips that follow a bot push -# (made with App tokens, which do fire this event) re-run the verifier on the -# current head. The concurrency group below bounds the cost. +# of every PR. On #16567 changelog-fragment-guard's autofix pushed b9cd4bac +# with github.token (a Dependabot-triggered `pull_request` run sees no Actions +# secrets, so TOPUP_PUSH_TOKEN was empty; every run on that head reports +# actor=github-actions[bot]). That push fired the `pull_request` workflows +# but NOT this `pull_request_target` one, no label event followed for three +# days, and the context stayed "expected" until a human closed and reopened +# the PR — BLOCKED the whole time (#16567, #17036). A PAT or App-token push +# fires both event kinds, so the gap is specific to github.token pushes. +# Two things close it: +# - `labeled`/`unlabeled` (and `ready_for_review`) are listed, mirroring +# native-queue-policy.yml, so any App- or PAT-made label flip re-runs the +# verifier on the current head (github.token label flips fire nothing). +# - `workflow_dispatch`: changelog-fragment-guard dispatches this workflow +# on the PR branch right after a github.token autofix push. +# workflow_dispatch is one of the two events a github.token may trigger, +# and the run's check lands on the branch tip, i.e. the pushed head. Only +# same-repo branches are ever dispatched (the autofix never pushes to +# forks); such a run uses the GitHub-hosted ARM runner like fork PRs do. +# The concurrency group below bounds the cost. on: pull_request_target: types: [opened, edited, synchronize, reopened, ready_for_review, labeled, unlabeled] + workflow_dispatch: + inputs: + pr_number: + description: Number of the same-repo PR whose branch tip this run verifies (#17036) + required: true + type: string concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || inputs.pr_number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} permissions: @@ -33,6 +49,39 @@ jobs: env: PR_VERIFIER_IMAGE: ghcr.io/hivecommons/pr-verifier@sha256:8c2b63817c4bfa7de510ab699b154637f27a42f87826c98083903daf2a539943 steps: + # A dispatched run has no pull_request payload. Rebuild one from the API + # for the verifier image, and bail out (green, nothing verified, said so) + # when the PR head is no longer this ref's tip: whoever moved it fired + # the normal events, and a verdict on a non-head commit is noise. + - name: Reconstruct the pull_request payload for a dispatched run + if: github.event_name == 'workflow_dispatch' + id: dispatch_event + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ inputs.pr_number }} + run: | + set -euo pipefail + if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then + echo "::error::pr_number must be a PR number, got '$PR_NUMBER'" + exit 1 + fi + pr="$(gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}")" + head_repo="$(jq -r '.head.repo.full_name' <<<"$pr")" + head_sha="$(jq -r '.head.sha' <<<"$pr")" + if [ "$head_repo" != "$GITHUB_REPOSITORY" ]; then + echo "::error::#${PR_NUMBER} comes from ${head_repo}; only same-repo PRs may be dispatched" + exit 1 + fi + if [ "$head_sha" != "$GITHUB_SHA" ]; then + echo "::notice::#${PR_NUMBER} head is ${head_sha}, not this run's ${GITHUB_SHA}; the push that moved it fired pr-verifier itself — nothing verified here (#17036)." + echo "stale=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + repo="$(gh api "repos/${GITHUB_REPOSITORY}")" + jq -n --argjson pr "$pr" --argjson repo "$repo" \ + '{action: "synchronize", number: $pr.number, pull_request: $pr, repository: $repo}' \ + > "${RUNNER_TEMP}/pr-verifier-event.json" + echo "event_path=${RUNNER_TEMP}/pr-verifier-event.json" >> "$GITHUB_OUTPUT" # Login and pull are advisory for the same reason the verification below # is: this check exists to report on PR CONTENTS, and a registry-side # failure (org rename, package visibility change, GHCR outage — #6085 @@ -69,21 +118,26 @@ jobs: run: | echo "::warning::PR Verifier image $PR_VERIFIER_IMAGE was unavailable or incompatible — verification was SKIPPED, not passed. Inspect the pull/platform error; this is a runner/registry/image problem, not a PR problem (#6085)." - name: Verifier action - if: steps.pull.outcome == 'success' + if: steps.pull.outcome == 'success' && steps.dispatch_event.outputs.stale != 'true' id: verifier continue-on-error: true + env: + # A dispatched run presents itself to the image as the + # pull_request_target run it stands in for (see dispatch_event). + VERIFIER_EVENT_NAME: ${{ github.event_name == 'workflow_dispatch' && 'pull_request_target' || github.event_name }} + VERIFIER_EVENT_PATH: ${{ steps.dispatch_event.outputs.event_path || github.event_path }} run: | docker run --rm \ -e INPUT_GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" \ -e GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" \ -e GITHUB_ACTIONS="true" \ - -e GITHUB_EVENT_NAME="$GITHUB_EVENT_NAME" \ + -e GITHUB_EVENT_NAME="$VERIFIER_EVENT_NAME" \ -e GITHUB_EVENT_PATH="/github/event.json" \ -e GITHUB_REPOSITORY="$GITHUB_REPOSITORY" \ -e GITHUB_SHA="$GITHUB_SHA" \ -e GITHUB_REF="$GITHUB_REF" \ -e GITHUB_WORKSPACE="/github/workspace" \ - -v "$GITHUB_EVENT_PATH:/github/event.json:ro" \ + -v "$VERIFIER_EVENT_PATH:/github/event.json:ro" \ -v "$GITHUB_WORKSPACE:/github/workspace:ro" \ "$PR_VERIFIER_IMAGE" - name: Report verifier failure