File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Create Git Tag
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ tag_name :
7+ description : " Tag name (eg. v1.3.0)"
8+ required : true
9+ type : string
10+
11+ permissions :
12+ contents : write
13+
14+ jobs :
15+ create_tag :
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v4
21+ with :
22+ fetch-depth : 0 # serve per i tag
23+
24+ - name : Configure Git
25+ run : |
26+ git config user.name "github-actions[bot]"
27+ git config user.email "github-actions[bot]@users.noreply.github.com"
28+
29+ - name : Check if the tag is already existing
30+ run : |
31+ TAG="${{ inputs.tag_name }}"
32+ git fetch --tags
33+ if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
34+ echo "❌ Tag $TAG esiste già"
35+ exit 1
36+ fi
37+
38+ - name : Create and push the tag
39+ run : |
40+ TAG="${{ inputs.tag_name }}"
41+ git tag "$TAG"
42+ git push origin "$TAG"
You can’t perform that action at this time.
0 commit comments