Skip to content

Release: v1.1.0

Release: v1.1.0 #3

Workflow file for this run

name: Release (tag)
on:
pull_request:
types: [closed]
branches:
- main
jobs:
tag-release:
if: "${{ github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'Release: ') }}"
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- run: |
VERSION=$(node -p "require('./package.json').version")
TAG="v$VERSION"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
if git ls-remote --tags origin | grep -q "refs/tags/$TAG$"; then
echo "::error::Tag $TAG already exists. Bump the version in package.json first."
exit 1
fi
git tag "$TAG"
git push origin "$TAG"