forked from mathLab/PyGeM
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 981 Bytes
/
create-tag.yml
File metadata and controls
42 lines (35 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Create Git Tag
on:
workflow_dispatch:
inputs:
tag_name:
description: "Tag name (eg. v1.3.0)"
required: true
type: string
permissions:
contents: write
jobs:
create_tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # serve per i tag
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Check if the tag is already existing
run: |
TAG="${{ inputs.tag_name }}"
git fetch --tags
if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
echo "❌ Tag $TAG esiste già"
exit 1
fi
- name: Create and push the tag
run: |
TAG="${{ inputs.tag_name }}"
git tag "$TAG"
git push origin "$TAG"