File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments