Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Automatically update major tags

on:
push:
tags:
- "v*.*.*"

jobs:
update-major-tag:
name: Update major tag
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Configure git
run: |
git config user.name github-actions
git config user.email github-actions@github.com

- name: Update tags
run: |
set -eu

NEW_TAG="${GITHUB_REF#refs/tags/}"
[ -z "$NEW_TAG" ] && exit 10

MAJOR=$(expr "$NEW_TAG" : '\(v[0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*$')
[ -z "$MAJOR" ] && exit 20

git fetch --tags
git tag -f "$MAJOR" "$NEW_TAG"
git push origin "$MAJOR" --force