chore: add workflow to auto-update major version tag on release

Adds update-major-tag.yml that triggers on any published release and
force-updates the major version tag (e.g., v6) to point to the latest
release (e.g., v6.0.1). Enables users to pin to @v6 instead of full
version numbers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dragan Filipovic
2026-04-02 22:59:30 +02:00
parent be39df3f93
commit 76668b2cd6

23
.github/workflows/update-major-tag.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Update major version tag
on:
release:
types: [published]
jobs:
update-tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Update major version tag
run: |
VERSION="${{ github.event.release.tag_name }}"
MAJOR="v$(echo "$VERSION" | sed 's/^v//' | cut -d. -f1)"
echo "Updating $MAJOR tag to point to $VERSION"
git tag -f "$MAJOR" "$VERSION"
git push -f origin "$MAJOR"