Skip to content

fix: release pipeline + 4-digit version support (v0.8.10) (#34) #1

fix: release pipeline + 4-digit version support (v0.8.10) (#34)

fix: release pipeline + 4-digit version support (v0.8.10) (#34) #1

Workflow file for this run

name: Auto-tag on VERSION change
on:
push:
branches: [main]
paths: [VERSION]
permissions:
contents: write
jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Read version and create tag
run: |
VERSION=$(cat VERSION | tr -d '[:space:]')
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$'; then
echo "Invalid VERSION format: '$VERSION'"
exit 1
fi
TAG="v${VERSION}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists — skipping."
exit 0
fi
echo "Creating tag $TAG"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "$TAG" -m "Release ${VERSION}"
git push origin "$TAG"
echo "Tagged $TAG successfully."