From 4ebc188109e152bfda5215ce2a6f4e32bf9402e5 Mon Sep 17 00:00:00 2001 From: devswithme Date: Fri, 7 Nov 2025 09:41:44 +0800 Subject: [PATCH] chore: fix ci.yml issue #5 --- .github/workflows/npm.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 034ae84..c5ccf53 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -42,7 +42,13 @@ jobs: run: | echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc - npm version patch -m "ci: release %s" - npm publish || echo "Version already published, skipping..." + NEW_VERSION=$(npm version patch -m "ci: release %s") + CURRENT_VERSION=$(npm view @fydemy/ui version) + + if [ "$CURRENT_VERSION" = "$NEW_VERSION" ]; then + echo "Version $NEW_VERSION already exists, skipping publish" + else + npm publish + fi git push https://${GH_TOKEN}@github.com/${{ github.repository }} main --follow-tags