fix release workflow: skip tag push if tag exists, bump Node to lts/*

Prevented exit-128 crash when a fix commit pushes to master at the same
version — the workflow now checks for an existing remote tag before
attempting to push one, so the release step can still create the GitHub
release even if the tag is already there.

Also updated both workflows from node-version 20.x to lts/* ahead of the
GitHub-enforced Node 24 migration deadline (2026-06-02).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
isaprettycoolguy@protonmail.com 2026-05-15 14:26:12 -04:00
parent 96eef77ffa
commit 6a85426571
2 changed files with 11 additions and 4 deletions

View file

@ -15,7 +15,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "lts/*"
cache: "npm"
- name: Install dependencies

View file

@ -29,12 +29,17 @@ jobs:
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
if git ls-remote --tags origin "${{ steps.version.outputs.version }}" | grep -q .; then
echo "tag_exists=true" >> $GITHUB_OUTPUT
else
echo "tag_exists=false" >> $GITHUB_OUTPUT
fi
- name: Use Node.js
if: steps.check.outputs.exists == 'false'
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "lts/*"
cache: "npm"
- name: Install dependencies
@ -57,8 +62,10 @@ jobs:
version="${{ steps.version.outputs.version }}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "$version" -m "$version"
git push origin "$version"
if [ "${{ steps.check.outputs.tag_exists }}" != "true" ]; then
git tag -a "$version" -m "$version"
git push origin "$version"
fi
gh release create "$version" \
--title="$version" \
--generate-notes \