From 2aff05b6323e6b309f2683a243d0f989713a6006 Mon Sep 17 00:00:00 2001 From: Gandalf the Greybeard <9+pe_gandalf@noreply.git.farh.net> Date: Wed, 20 May 2026 21:01:16 +0000 Subject: [PATCH] fix(ci): use github.head_ref for SOURCE_REF detection in promotion gate Co-Authored-By: Paperclip --- .github/workflows/dual-approval.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dual-approval.yaml b/.github/workflows/dual-approval.yaml index 4412e78..8718611 100644 --- a/.github/workflows/dual-approval.yaml +++ b/.github/workflows/dual-approval.yaml @@ -28,6 +28,7 @@ jobs: PR_NUMBER: ${{ github.event.pull_request.number }} REPO: ${{ github.repository }} BASE_REF: ${{ github.base_ref }} + HEAD_REF: ${{ github.head_ref }} run: | if [ -z "${PR_NUMBER}" ] || [ "${PR_NUMBER}" = "null" ]; then echo "::notice::No PR number in context. Skipping promotion gate." @@ -59,10 +60,7 @@ jobs: GATE_NAME="QA" # For plugin repos (Pipeline A), UAT approval is needed for uat→main # Check if the source branch is uat - SOURCE_REF=$(curl -sf \ - -H "Authorization: token ${GITEA_TOKEN}" \ - -H "Accept: application/json" \ - "https://git.farh.net/api/v1/repos/${REPO}/pulls/${PR_NUMBER}" | jq -r '.head.ref') + SOURCE_REF="${HEAD_REF}" if [ "${SOURCE_REF}" = "uat" ]; then REQUIRED_REVIEWER="pe_patty" @@ -113,4 +111,4 @@ jobs: else echo "Promotion gate failed: waiting for ${GATE_NAME} approval from ${REQUIRED_REVIEWER}." exit 1 - fi \ No newline at end of file + fi