We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent edd03c5 commit 7e32477Copy full SHA for 7e32477
.github/workflows/versions.yaml
@@ -0,0 +1,33 @@
1
+name: Automatically update major tags
2
+
3
+on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
8
+jobs:
9
+ update-major-tag:
10
+ name: Update major tag
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v5
15
16
+ - name: Configure git
17
+ run: |
18
+ git config user.name github-actions
19
+ git config user.email github-actions@github.com
20
21
+ - name: Update tags
22
23
+ set -eu
24
25
+ NEW_TAG="${GITHUB_REF#refs/tags/}"
26
+ [ -z "$NEW_TAG" ] && exit 10
27
28
+ MAJOR=$(expr "$NEW_TAG" : '\(v[0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*$')
29
+ [ -z "$MAJOR" ] && exit 20
30
31
+ git fetch --tags
32
+ git tag -f "$MAJOR" "$NEW_TAG"
33
+ git push origin "$MAJOR" --force
0 commit comments