File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches : [ main ]
66 tags :
7- - ' v*' # Push events to matching v*, i.e. v1.0, v20.15.10 including semver
7+ - ' v*.*.* ' # Push events to matching semantic versions only ( v1.0.0, v1.2.3, etc.)
88 pull_request :
99 branches : [ main ]
1010 workflow_dispatch :
@@ -287,4 +287,21 @@ jobs:
287287 name : Release ${{ github.ref_name }}
288288 generate_release_notes : true
289289 tag_name : ${{ github.ref }}
290- token : ${{ secrets.GITHUB_TOKEN }}
290+ token : ${{ secrets.GITHUB_TOKEN }}
291+
292+ - name : Update major version tag
293+ if : ${{ !contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc') }}
294+ run : |
295+ # Extract major version from tag (e.g., v1.2.3 -> v1)
296+ TAG_NAME=${GITHUB_REF#refs/tags/}
297+ MAJOR_VERSION=$(echo $TAG_NAME | sed -E 's/^(v[0-9]+)\..*/\1/')
298+
299+ echo "Updating major version tag $MAJOR_VERSION to point to $TAG_NAME"
300+
301+ # Configure git
302+ git config user.name "github-actions[bot]"
303+ git config user.email "github-actions[bot]@users.noreply.github.com"
304+
305+ # Create/update the major version tag
306+ git tag -f $MAJOR_VERSION
307+ git push origin $MAJOR_VERSION --force
You can’t perform that action at this time.
0 commit comments