File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-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
23+ persist-credentials : false
24+
25+ - name : Configure git with PAT
26+ run : |
27+ git config user.name "github-actions[bot]"
28+ git config user.email "github-actions[bot]@users.noreply.github.com"
29+ git remote set-url origin "https://x-access-token:${{ secrets.PAT_BLADEX_PUSH }}@github.com/${{ github.repository }}.git"
30+
31+ - name : Check if the tag is already existing
32+ run : |
33+ TAG="${{ inputs.tag_name }}"
34+ git fetch --tags
35+ if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
36+ echo "❌ Tag $TAG already exists"
37+ exit 1
38+ fi
39+
40+ - name : Create and push the tag
41+ run : |
42+ TAG="${{ inputs.tag_name }}"
43+ git tag "$TAG"
44+ git push origin "$TAG"
You can’t perform that action at this time.
0 commit comments