Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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
persist-credentials: false

- name: Configure git with PAT
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${{ secrets.PAT_PINA_PUSH }}@github.com/${{ github.repository }}.git"

- 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 already exists"
exit 1
fi

- name: Create and push the tag
run: |
TAG="${{ inputs.tag_name }}"
git tag "$TAG"
git push origin "$TAG"