Browse Source

chore: update publish.yml workflow

pointhalo 2 years ago
parent
commit
4913099edd
1 changed files with 7 additions and 2 deletions
  1. 7 2
      .github/workflows/publish.yml

+ 7 - 2
.github/workflows/publish.yml

@@ -33,8 +33,13 @@ jobs:
               run: |
                   git config --global user.name 'semi-bot'
                   git config --global user.email '[email protected]'
-                  git add .
-                  git commit --no-verify -m "chore: publish ${{ env.RELEASE_VERSION }}"
+                  if [ -n "$(git status --porcelain)" ]; then
+                    echo "there are changes";
+                    git add .
+                    git commit --no-verify -m "chore: publish ${{ env.RELEASE_VERSION }}"
+                  else
+                    echo "no changes";
+                  fi
                   npm config set registry=https://registry.npmjs.org/
                   npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
                   npm whoami