File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
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 }}"
You can’t perform that action at this time.
0 commit comments