File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 99 steps :
1010 - name : Checkout
1111 uses : actions/checkout@v4
12- - name : Update v4 tag
13- run : git tag -f v4
12+ - name : Extract Major and Minor Versions from Tag
13+ id : extract-version
14+ run : |
15+ TAG_NAME="${{ github.event.release.tag_name }}"
16+ # Ensure the tag follows semantic versioning (e.g., v1.2.3)
17+ if [[ "$TAG_NAME" =~ ^v([0-9]+)\.([0-9]+) ]]; then
18+ MAJOR="${BASH_REMATCH[1]}"
19+ MINOR="${BASH_REMATCH[2]}"
20+ echo "MAJOR=$MAJOR" >> $GITHUB_ENV
21+ echo "MINOR=$MINOR" >> $GITHUB_ENV
22+ echo "Extracted Major: $MAJOR, Minor: $MINOR"
23+ else
24+ echo "Invalid tag format: $TAG_NAME"
25+ exit 1
26+ fi
27+
28+ - name : Update Major and Minor Tags
29+ run : |
30+ # Create or update major version tag
31+ git tag -f v$MAJOR
32+ # Create or update minor version tag
33+ git tag -f v$MAJOR.$MINOR
1434 - name : Push changes
1535 uses : ad-m/github-push-action@master
1636 with :
You can’t perform that action at this time.
0 commit comments