From 8e177aef844fe2678fa1decd363b7cc4be604d50 Mon Sep 17 00:00:00 2001 From: Aniruddha Shriwant Date: Mon, 6 Jul 2026 15:54:29 +0530 Subject: [PATCH] fix: fall back to master workflows ref for merge-queue refs github.workflow_ref on merge_group events resolves to the caller's refs/heads/gh-readonly-queue/* ref, which does not exist in the workflows repository. The validator-script checkout then fails with git exit code 1 and dequeues the PR from the merge queue. Treat merge-queue refs like refs/pull/* and fall back to master. --- .github/workflows/validate-pnpm-config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate-pnpm-config.yml b/.github/workflows/validate-pnpm-config.yml index 2a472e3..49da9ab 100644 --- a/.github/workflows/validate-pnpm-config.yml +++ b/.github/workflows/validate-pnpm-config.yml @@ -63,9 +63,10 @@ jobs: set -euo pipefail ref="${WORKFLOW_REF##*@}" - # Caller workflows on pull_request can resolve to refs/pull//merge, which - # does not exist in the workflows repository. Fall back to the configured branch. - if [[ -z "${ref}" || "${ref}" == refs/pull/* ]]; then + # Caller workflows on pull_request resolve to refs/pull//merge and on + # merge_group to refs/heads/gh-readonly-queue/*, neither of which exists in + # the workflows repository. Fall back to the configured branch. + if [[ -z "${ref}" || "${ref}" == refs/pull/* || "${ref}" == refs/heads/gh-readonly-queue/* ]]; then ref="${WORKFLOWS_FALLBACK_REF}" elif [[ "${ref}" == refs/heads/* ]]; then ref="${ref#refs/heads/}"