From 61cf9bc4097a247e25edd2b53e50e1d852b335a6 Mon Sep 17 00:00:00 2001 From: boronine-bot Date: Tue, 16 Jun 2026 09:46:38 +0000 Subject: [PATCH] Add prerelease --tag handling to npm publish workflow --- .github/workflows/npm-publish.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index c05ab04..4bdd6c2 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -32,10 +32,15 @@ jobs: - name: Publish to npm run: | package_version="$(node -p "require('./package.json').version")" - # Skip if this version is already published if npm view "hsluv-sass@${package_version}" version 2>/dev/null; then echo "hsluv-sass@${package_version} is already published, skipping" exit 0 fi - echo "Publishing hsluv-sass@${package_version}" - npm publish --provenance --access public + if [[ "$package_version" =~ -([a-zA-Z]+) ]]; then + tag="${BASH_REMATCH[1]}" + echo "Publishing prerelease with dist-tag: $tag" + npm publish --provenance --access public --tag "$tag" + else + echo "Publishing stable release" + npm publish --provenance --access public + fi