mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-25 00:22:43 -05:00
ci: fix release.yml (#4773)
This commit is contained in:
13
.github/workflows/release.yml
vendored
13
.github/workflows/release.yml
vendored
@@ -45,13 +45,18 @@ jobs:
|
||||
# Extract pre-release tag (e.g., beta, rc)
|
||||
NPM_TAG=${BASH_REMATCH[1]}
|
||||
else
|
||||
# Check if the commit is on the main branch
|
||||
# Check if the commit is on the main branch or a version branch
|
||||
git fetch origin main
|
||||
if git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
|
||||
CURRENT_BRANCH=$(git branch -r --contains "$GITHUB_SHA" | grep -E 'origin/(main|v[0-9]+\.[0-9]+\.x-latest)' | head -1 | sed 's/.*origin\///')
|
||||
|
||||
if [[ "$CURRENT_BRANCH" == "main" ]]; then
|
||||
NPM_TAG="latest"
|
||||
elif [[ "$CURRENT_BRANCH" =~ ^v[0-9]+\.[0-9]+\.x-latest$ ]]; then
|
||||
# For version branches like v1.3.x-latest, v1.4.x-latest, use "latest" tag
|
||||
NPM_TAG="latest"
|
||||
else
|
||||
echo "The tagged commit is not on the main branch."
|
||||
echo "::error ::Releases with the 'latest' npm tag must be on the main branch."
|
||||
echo "The tagged commit is not on the main branch or a version branch (v*.*.x-latest)."
|
||||
echo "::error ::Releases with the 'latest' npm tag must be on the main branch or a version branch."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user