Skip to content

Commit c5eae3f

Browse files
committed
Trying to get the full branch name in release.yml
1 parent a4fcc4b commit c5eae3f

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,22 @@ jobs:
2828
with:
2929
fetch-depth: 0
3030

31-
- name: Construct Dev Version String
31+
- name: Construct Dev Version String
3232
id: versioning
3333
shell: bash
3434
run: |
3535
echo "--- Start Version Construction ---"
36-
BRANCH_NAME="${{ github.ref_name }}"
37-
echo "1. Full Branch Name (github.ref_name): $BRANCH_NAME"
36+
# --- THIS IS THE FIX ---
37+
# Use github.ref which contains the full path, e.g., refs/heads/REL_.../TKT_...
38+
FULL_REF="${{ github.ref }}"
39+
echo "1. Full Git Ref (github.ref): $FULL_REF"
3840
39-
BASE_VERSION=$(echo "$BRANCH_NAME" | sed -n 's/.*REL_\([0-9.]*\)\/TKT_.*/\1/p')
41+
# This robustly extracts the version by finding what's between "REL_" and "/TKT_"
42+
BASE_VERSION=$(echo "$FULL_REF" | sed -n 's/.*REL_\([0-9.]*\)\/TKT_.*/\1/p')
4043
echo "2. Parsed BASE_VERSION: $BASE_VERSION"
4144
42-
TICKET_NUM=$(echo "$BRANCH_NAME" | grep -oP 'TKT_[0-9]+' | sed 's/TKT_//')
45+
# This robustly extracts the ticket number from the full ref
46+
TICKET_NUM=$(echo "$FULL_REF" | grep -oP 'TKT_[0-9]+' | sed 's/TKT_//')
4347
echo "3. Parsed TICKET_NUM: $TICKET_NUM"
4448
4549
BRANCH_BUILD_NUM=$(git rev-list --count HEAD)

0 commit comments

Comments
 (0)