File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,20 +11,26 @@ permissions:
1111jobs :
1212 tag :
1313 runs-on : ubuntu-latest
14- if : startsWith(github.event.head_commit.message, 'chore(release): v')
1514 steps :
1615 - name : Checkout
1716 uses : actions/checkout@v4
1817 with :
1918 fetch-depth : 0
2019
21- - name : Create and push tag
20+ - name : Create and push tag for release commits
2221 run : |
22+ MESSAGE="${{ github.event.head_commit.message }}"
23+ if [[ "$MESSAGE" != chore\(release\):\ v* ]]; then
24+ echo "Not a release commit; skipping"
25+ exit 0
26+ fi
27+
2328 VERSION="v$(node -p \"require('./package.json').version\")"
2429 if git ls-remote --tags origin | grep -q "refs/tags/${VERSION}$"; then
2530 echo "Tag ${VERSION} already exists; skipping"
2631 exit 0
2732 fi
33+
2834 git config user.name "github-actions[bot]"
2935 git config user.email "github-actions[bot]@users.noreply.github.com"
3036 git tag "${VERSION}" -m "Release ${VERSION}"
You can’t perform that action at this time.
0 commit comments