File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Update major version tag
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*.**'
7+
8+ jobs :
9+ update-major-version-tag :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+
14+ - name : Update major version tag
15+ shell : bash
16+ env :
17+ GIT_AUTHOR_NAME : ' GitHub Actions'
18+ GIT_COMMITTER_NAME : ' GitHub Actions'
19+ GIT_AUTHOR_EMAIL : 41898282+github-actions[bot]@users.noreply.github.com
20+ GIT_COMMITTER_EMAIL : 41898282+github-actions[bot]@users.noreply.github.com
21+ EMAIL : 41898282+github-actions[bot]@users.noreply.github.com
22+ # Documentation of GITHUB_REF, GITHUB_REF_NAME and GITHUB_SHA:
23+ #
24+ # https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push
25+ # https://docs.github.com/en/actions/reference/variables-reference#default-environment-variables
26+ #
27+ # We want the major version tag to point to the target of the specific
28+ # tag, not to the tag, to avoid warnings about nested tags.
29+ run : |
30+ MAJOR_VERSION=${GITHUB_REF_NAME%%.*}
31+ git tag -f -a -m "Update $MAJOR_VERSION to $GITHUB_REF_NAME" $MAJOR_VERSION $GITHUB_SHA
32+ git push origin +$MAJOR_VERSION
You can’t perform that action at this time.
0 commit comments