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
35 changes: 35 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Release Tag on Release PR Merge

on:
pull_request:
types: [closed]
branches: [main]

permissions:
contents: write

jobs:
create-tag:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release-v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Extract version from branch name
id: version
env:
BRANCH: ${{ github.event.pull_request.head.ref }}
run: |
VERSION="${BRANCH#release-}"
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid version format: $VERSION"
exit 1
fi
echo "tag=${VERSION}" >> "$GITHUB_OUTPUT"

- name: Create and push tag
env:
TAG: ${{ steps.version.outputs.tag }}
run: |
git tag "$TAG"
git push origin "$TAG"