File tree Expand file tree Collapse file tree 3 files changed +36
-3
lines changed
Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Original file line number Diff line number Diff line change 1+ name : 🔖 Auto Tag on Version Change
2+
3+ on :
4+ push :
5+ branches : [main]
6+ paths :
7+ - " package.json"
8+
9+ jobs :
10+ tag :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - uses : actions/checkout@v4
15+ with :
16+ token : ${{ secrets.GITHUB_TOKEN }}
17+
18+ - name : Read version
19+ id : version
20+ run : |
21+ VERSION=$(node -p "require('./package.json').version")
22+ echo "version=$VERSION" >> $GITHUB_OUTPUT
23+
24+ - name : Check if tag exists
25+ run : |
26+ if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
27+ echo "Tag already exists, skipping."
28+ exit 0
29+ fi
30+
31+ - name : Create tag
32+ run : |
33+ git tag "v${{ steps.version.outputs.version }}"
34+ git push origin "v${{ steps.version.outputs.version }}"
Original file line number Diff line number Diff line change @@ -26,15 +26,15 @@ jobs:
2626 run : npm ci
2727
2828 - name : Auto bump version
29- if : " ! contains(github.event.head_commit.message, '[skip publish]')"
29+ if : ${{ ! contains(github.event.head_commit.message, '[skip publish]') }}
3030 run : |
3131 npm version patch --no-git-tag-version
3232 git add package.json
3333 git commit -m "ci: auto bump patch version [skip ci]" || echo "No version bump needed"
3434 git push || echo "No changes to push"
3535
3636 - name : Publish to npm
37- if : " ! contains(github.event.head_commit.message, '[skip publish]')"
37+ if : ${{ ! contains(github.event.head_commit.message, '[skip publish]') }}
3838 env :
3939 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
4040 run : |
Original file line number Diff line number Diff line change 2424 " coderooz"
2525 ],
2626 "main" : " index" ,
27- "type" : " module" ,
2827 "files" : [
2928 " App.tsx" ,
3029 " index.ts" ,
You can’t perform that action at this time.
0 commit comments