File tree Expand file tree Collapse file tree 3 files changed +24
-5485
lines changed
Expand file tree Collapse file tree 3 files changed +24
-5485
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches : [main]
66
7+ concurrency :
8+ group : release-${{ github.ref }}
9+ cancel-in-progress : false
10+
711permissions :
812 contents : write
913 issues : write
1014 pull-requests : write
1115
1216jobs :
1317 release :
18+ if : ${{ !startsWith(github.event.head_commit.message || '', 'chore(release):') }}
1419 runs-on : ubuntu-latest
1520 steps :
1621 - name : Checkout
17221823 with :
1924 fetch-depth : 0
2025
26+ - name : Validate release tag ancestry
27+ shell : bash
28+ run : |
29+ set -euo pipefail
30+ latest_tag="$(git tag -l 'v*' --sort=-version:refname | head -n 1 || true)"
31+ if [[ -z "${latest_tag}" ]]; then
32+ echo "No existing v* tags found; continuing."
33+ exit 0
34+ fi
35+ if git merge-base --is-ancestor "${latest_tag}" HEAD; then
36+ echo "Latest tag ${latest_tag} is reachable from HEAD."
37+ exit 0
38+ fi
39+ echo "::error::Latest tag ${latest_tag} is not reachable from HEAD. Release tags are out of sync with branch history."
40+ echo "::error::Fix by re-aligning tags to this branch history before running semantic-release."
41+ exit 1
42+
2143 - name : Set up Node
2244 uses : actions/setup-node@v6
2345 with :
3153
3254 - name : Run semantic-release
3355 env :
34- GITHUB_TOKEN : ${{ secrets.RELEASE_BOT_TOKEN }}
56+ GITHUB_TOKEN : ${{ secrets.RELEASE_BOT_TOKEN || github.token }}
3557 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
3658 run : npx semantic-release --extends ./release.config.mjs
You can’t perform that action at this time.
0 commit comments