File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Auto Tag on Version Bump
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ paths :
8+ - VERSION
9+
10+ jobs :
11+ tag-repo :
12+ runs-on : ubuntu-latest
13+ permissions :
14+ contents : write
15+ steps :
16+ - name : Check out repository
17+ uses : actions/checkout@v5
18+
19+ - name : Get current version
20+ id : version
21+ run : |
22+ VERSION=$(cat VERSION)
23+ echo "version=$VERSION" >> $GITHUB_OUTPUT
24+
25+ - name : Skip if tag already exists
26+ run : |
27+ if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
28+ echo "skip=true" >> $GITHUB_OUTPUT
29+ else
30+ echo "skip=false" >> $GITHUB_OUTPUT
31+ fi
32+
33+ - name : Push tag
34+ if : steps.checktag.outputs.skip == 'false'
35+ run : |
36+ git config user.name "github-actions[bot]"
37+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+ git tag "v${{ steps.version.outputs.version }}"
39+ git push origin "v${{ steps.version.outputs.version }}"
You can’t perform that action at this time.
0 commit comments