Skip to content

ci: switch release flow to PR-based tagging #1

ci: switch release flow to PR-based tagging

ci: switch release flow to PR-based tagging #1

Workflow file for this run

name: Tag Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
tag:
runs-on: ubuntu-latest
if: startsWith(github.event.head_commit.message, 'chore(release): v')

Check failure on line 14 in .github/workflows/tag-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/tag-release.yml

Invalid workflow file

You have an error in your yaml syntax on line 14
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create and push tag
run: |
VERSION="v$(node -p \"require('./package.json').version\")"
if git ls-remote --tags origin | grep -q "refs/tags/${VERSION}$"; then
echo "Tag ${VERSION} already exists; skipping"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "${VERSION}" -m "Release ${VERSION}"
git push origin "${VERSION}"