File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Releases
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ release_tag :
7+ description : Git tag associated with the new release
8+ required : true
9+ type : string
10+
11+ jobs :
12+ update-major-version-tag :
13+ name : Update major version tag
14+ permissions :
15+ contents : write
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout repository
19+ uses : actions/checkout@v4
20+ with :
21+ fetch-depth : 0 # Fetch entire Git history
22+
23+ - name : Extract major version
24+ run : |
25+ release_tag=${{ inputs.release_tag }}
26+ major_version=$(echo $release_tag | awk -F'.' '{ print $1 }')
27+ if [ ! "$major_version" =~ ^v[0-9]+$ ]; then
28+ echo "Release tag does not follow Semantic Versioning"
29+ echo "Cannot continue, exiting..."
30+ exit 1
31+ fi
32+
33+ echo "Successfully extracted major version '$major_version'"
34+ echo "major_version=$major_version" >> $GITHUB_ENV
35+
36+ - name : Update Git tag
37+ run : git tag -f ${{ env.major_version }} ${{ inputs.release_tag }}
38+
39+ - name : Push changes
40+ run : git push origin ${{ env.major_version }} --force --follow-tags
You can’t perform that action at this time.
0 commit comments