Skip to content

Bump version to 1.0.2 and automate tag creation on VERSION change (#1) #1

Bump version to 1.0.2 and automate tag creation on VERSION change (#1)

Bump version to 1.0.2 and automate tag creation on VERSION change (#1) #1

Workflow file for this run

name: create-tag
on:
push:
branches: ["main"]
paths: ["VERSION"]
jobs:
tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read version
id: version
run: echo "tag=v$(xargs < VERSION)" >> "$GITHUB_OUTPUT"
- name: Create and push tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
TAG="${{ steps.version.outputs.tag }}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists, skipping."
exit 0
fi
git tag "$TAG"
git push origin "$TAG"