File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 workflow_dispatch :
55 inputs :
66 version :
7- description : ' CalVer version (e.g. 2026 .0.0)'
7+ description : ' SemVer version (e.g. 1 .0.0)'
88 required : true
99 type : string
1010 push :
1111 tags :
12- - ' [0-9][0-9][0-9][0-9].*'
12+ - ' v[0-9]*'
13+ - ' [0-9]*'
1314
1415permissions :
1516 contents : read
@@ -35,10 +36,12 @@ jobs:
3536 echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
3637 fi
3738
38- - name : Validate CalVer format
39+ - name : Validate SemVer format
3940 run : |
40- if ! echo "${{ steps.version.outputs.tag }}" | grep -qE '^[0-9]{4}\.[0-9]+\.[0-9]+$'; then
41- echo "Error: Version must be in CalVer format YYYY.MINOR.PATCH (e.g. 2026.0.0)"
41+ VERSION="${{ steps.version.outputs.tag }}"
42+ VERSION="${VERSION#v}"
43+ if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
44+ echo "Error: Version must be in SemVer format MAJOR.MINOR.PATCH (e.g. 1.0.0)"
4245 exit 1
4346 fi
4447
5154 - name : Get previous tag
5255 id : previous
5356 run : |
54- PREVIOUS=$(git tag --sort=-v:refname | grep -E '^[0-9]{4}\.' | grep - v "^${{ steps.version.outputs.tag }}$" | head -1)
57+ PREVIOUS=$(git tag --sort=-v:refname | grep -v "^${{ steps.version.outputs.tag }}$" | head -1)
5558 echo "tag=$PREVIOUS" >> "$GITHUB_OUTPUT"
5659
5760 - name : Generate changelog
You can’t perform that action at this time.
0 commit comments