From da38b92f3bf974d7cd1128da739b4fecee799f9d Mon Sep 17 00:00:00 2001 From: sure-admin Date: Sat, 1 Aug 2026 20:09:09 +0000 Subject: [PATCH] fix(ci): quote prerelease tag source branch lookup --- .github/workflows/publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cd0661758..eacc0b60a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -426,6 +426,8 @@ jobs: steps: - name: Determine source branch for tag id: source_branch + env: + TAG_NAME: ${{ github.ref_name }} run: | # Fetch all branches to find which one contains this tag's commit git init --quiet @@ -439,7 +441,7 @@ jobs: # Prefer the matching release branch over main. Do not select arbitrary # feature or PR branches that happen to contain the tagged commit. SOURCE_BRANCH="main" - RELEASE_BRANCH="$(echo "${{ github.ref_name }}" | sed -E 's/^v([0-9]+)\.([0-9]+)\..*/v\1.\2-release-branch/')" + RELEASE_BRANCH="$(printf '%s\n' "$TAG_NAME" | sed -E 's/^v([0-9]+)\.([0-9]+)\..*/v\1.\2-release-branch/')" for branch in $BRANCHES; do if [ "$branch" = "$RELEASE_BRANCH" ]; then