From 5350458e2eeeafc96f5814553e2369f4c7af7c9d Mon Sep 17 00:00:00 2001 From: Thiago Zanluca Date: Mon, 13 Jul 2026 15:02:25 -0300 Subject: [PATCH] fix: skip the release job when there's nothing to publish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Release workflow runs on every push to main. On a merge with no pending changeset (Dependabot, docs, chore), changesets/action still ran `publish`, which tried to re-publish the current version. Since it's already on npm, changesets 2.31.0 crashed parsing npm's "already published" response instead of no-opping — red-X-ing every routine merge (e.g. run #27 from the #39 merge). Guard the step: only run changesets/action when a changeset is pending or the local version isn't the one published on npm. Routine merges now skip it; the real release paths (open the version PR / publish the bumped version) are unchanged. --- .github/workflows/release.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e416134..80c637d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,25 @@ jobs: - run: pnpm install --frozen-lockfile - run: pnpm test - run: pnpm build + # A push to main with no pending changeset AND the current version already + # on npm is a routine merge (Dependabot, docs, chore) — nothing to release. + # Without this guard, changesets/action still runs `publish`, which tries to + # re-publish the current version; changesets 2.31.0 then crashes parsing + # npm's "already published" response instead of no-opping. See failed run + # #27 (2026-07-13), triggered by the Dependabot merge in #39. + - name: Anything to release? + id: release_needed + run: | + pending=$(find .changeset -maxdepth 1 -name '*.md' ! -name 'README.md' | wc -l | tr -d ' ') + local_version=$(node -p "require('./package.json').version") + published_version=$(npm view xls-reader version 2>/dev/null || echo none) + if [ "$pending" != "0" ] || [ "$local_version" != "$published_version" ]; then + echo "run=true" >> "$GITHUB_OUTPUT" + else + echo "run=false" >> "$GITHUB_OUTPUT" + fi - name: Create release PR or publish to npm + if: steps.release_needed.outputs.run == 'true' uses: changesets/action@v1 with: version: pnpm run version-packages