File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-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 : Check if tag already exists
26+ id : checktag
27+ run : |
28+ if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
29+ echo "skip=true" >> $GITHUB_OUTPUT
30+ else
31+ echo "skip=false" >> $GITHUB_OUTPUT
32+ fi
33+
34+ - name : Push tag
35+ if : steps.checktag.outputs.skip == 'false'
36+ run : |
37+ git config user.name "github-actions[bot]"
38+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
39+ git tag "v${{ steps.version.outputs.version }}"
40+ git push origin "v${{ steps.version.outputs.version }}"
You can’t perform that action at this time.
0 commit comments