From aa8ed87bda58816a209c7943c0e6b75a31ff4094 Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Mon, 11 Aug 2025 23:44:57 +0000 Subject: [PATCH] fix: use github.head_ref for PR branch detection For pull requests, github.ref is refs/pull/N/merge, but github.head_ref contains the actual branch name. This should fix debug mode detection. --- .github/workflows/build-reusable.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.yml index 054ec66..a6a220d 100644 --- a/.github/workflows/build-reusable.yml +++ b/.github/workflows/build-reusable.yml @@ -246,6 +246,8 @@ jobs: echo "🔍 EVENT NAME: '${{ github.event_name }}'" echo "🔍 COMMIT MESSAGE: '${{ github.event.head_commit.message }}'" echo "🔍 Contains [debug]: '${{ contains(github.event.head_commit.message, '[debug]') }}'" + echo "🔍 GITHUB REF: '${{ github.ref }}'" + echo "🔍 GITHUB HEAD_REF: '${{ github.head_ref }}'" # Start tmate session INSIDE the test step if debug enabled # Force debug mode for this investigation branch @@ -256,7 +258,7 @@ jobs: elif [[ "${{ contains(github.event.head_commit.message, '[debug]') }}" == "true" ]]; then DEBUG_MODE=true echo "✅ Debug enabled via [debug] in commit message" - elif [[ "${{ github.ref }}" == "refs/heads/debug/clean-state-investigation" ]]; then + elif [[ "${{ github.head_ref }}" == "debug/clean-state-investigation" ]] || [[ "${{ github.ref }}" == "refs/heads/debug/clean-state-investigation" ]]; then DEBUG_MODE=true echo "✅ Debug enabled for debug investigation branch" fi