Skip to content

Commit 7893ac6

Browse files
use for prerelease too
1 parent 8527609 commit 7893ac6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/publish.reusable.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,16 @@ jobs:
3838
if: inputs.is-prerelease == 'true'
3939
run: |
4040
for package in packages/@postgrestools/*; do
41-
npm publish "$package" --tag nightly --access public --provenance
41+
package_basename=$(basename "$package")
42+
package_name="@postgrestools/$package_basename"
43+
package_version="${{ inputs.release-tag }}"
44+
45+
if npm view "$package_name@$package_version" version 2>/dev/null; then
46+
echo "Package $package_name@$package_version already exists, skipping..."
47+
else
48+
echo "Publishing $package_name@$package_version..."
49+
npm publish "$package" --tag nightly --access public --provenance
50+
fi
4251
done
4352
env:
4453
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} #

0 commit comments

Comments
 (0)