From 16a240c2763b2be3dedd49e78c3ba56a2423fbe8 Mon Sep 17 00:00:00 2001 From: Shengcun-Scanner Date: Wed, 18 Nov 2026 09:21:54 -0500 Subject: [PATCH] ci: read the branch name from the environment The maintenance-scope step echoed the head branch straight into its script, so a branch name containing a command substitution ran in the validation job. Read it from env instead. Co-Authored-By: Shengcun --- .github/workflows/validate-release-pr.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate-release-pr.yml b/.github/workflows/validate-release-pr.yml index a51b70b..657bc70 100644 --- a/.github/workflows/validate-release-pr.yml +++ b/.github/workflows/validate-release-pr.yml @@ -19,6 +19,8 @@ jobs: - name: Validate maintenance PR scope if: ${{ !startsWith(github.head_ref, 'release/code-scan-action-v') }} + env: + HEAD_REF: ${{ github.head_ref }} run: | set -euo pipefail @@ -30,7 +32,7 @@ jobs: fi done < <(git diff --name-only origin/main...HEAD) - echo "Branch ${{ github.head_ref }} is not a generated release branch; artifact mirror files are unchanged." + echo "Branch $HEAD_REF is not a generated release branch; artifact mirror files are unchanged." - name: Verify release source if: ${{ startsWith(github.head_ref, 'release/code-scan-action-v') }}