diff --git a/.github/workflows/changeset-handler.yml b/.github/workflows/changeset-handler.yml index 1984295..7adcc40 100644 --- a/.github/workflows/changeset-handler.yml +++ b/.github/workflows/changeset-handler.yml @@ -36,12 +36,23 @@ jobs: node-version: 20 cache: 'pnpm' + - name: Changeset status + id: changeset-status + shell: bash + run: | + if ! pnpm changeset:status &>/dev/null; then + echo "⚠️ Warning: No changesets found, should skip!" + echo "skip=true" >> "$GITHUB_OUTPUT" + fi + - name: Get pnpm store directory + if: ${{ steps.changeset-status.outputs.skip != 'true' }} shell: bash run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - uses: actions/cache@v4 + if: ${{ steps.changeset-status.outputs.skip != 'true' }} name: Setup pnpm cache with: path: ${{ env.STORE_PATH }} @@ -50,16 +61,19 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Install dependencies + if: ${{ steps.changeset-status.outputs.skip != 'true' }} run: | pnpm install \ --strict-peer-dependencies - name: Set version + if: ${{ steps.changeset-status.outputs.skip != 'true' }} run: | pnpm changeset:version git status --short - name: Commit changes + if: ${{ steps.changeset-status.outputs.skip != 'true' }} run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" diff --git a/package.json b/package.json index c9a3988..a21b573 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "build:ci": "pnpm run build", "bundle": "ts-node -r dotenv/config bundle.ts", "changeset:add": "npx changeset", + "changeset:add": "npx changeset status", "changeset:version": "pnpm exec changeset version", "clean": "pnpm \"/^clean:.*/\"", "clean:dist": "rm -rf dist",