From aae03f1126e7c38df0d718e9facd9692c6760e4a Mon Sep 17 00:00:00 2001 From: Volodymyr Vreshch Date: Sun, 25 Oct 2026 21:16:14 +0100 Subject: [PATCH] fix(prepare-release): skip while the current version is unpublished --- .github/workflows/prepare-release.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index b53974f..3e9b0aa 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -24,6 +24,7 @@ concurrency: env: TAG_GLOB: 'v[0-9]*' # obsidian plugins: '[0-9]*.[0-9]*.[0-9]*' (bare tags) + TAG_PREFIX: 'v' # obsidian plugins: '' (tag == manifest version) jobs: prepare: @@ -52,9 +53,19 @@ jobs: echo "skip=true" >> "$GITHUB_OUTPUT" fi + - name: Skip while the current version is still unpublished (no tag yet) + id: pending + if: steps.guard.outputs.skip != 'true' + run: | + V=$(node -p "require('./package.json').version") + if ! git rev-parse -q --verify "refs/tags/${TAG_PREFIX}${V}" >/dev/null; then + echo "Version ${V} has no tag - its release.yml publish has not landed. Not bumping again; run release.yml." | tee -a "$GITHUB_STEP_SUMMARY" + echo "skip=true" >> "$GITHUB_OUTPUT" + fi + - name: Decide bump id: decide - if: steps.guard.outputs.skip != 'true' + if: steps.guard.outputs.skip != 'true' && steps.pending.outputs.skip != 'true' run: | set -euo pipefail BUMP="${{ inputs.bump }}" @@ -74,7 +85,7 @@ jobs: - name: Bump version id: bump - if: steps.decide.outputs.bump != 'skip' && steps.guard.outputs.skip != 'true' + if: steps.decide.outputs.bump && steps.decide.outputs.bump != 'skip' run: | set -euo pipefail npm version --no-git-tag-version "${{ steps.decide.outputs.bump }}" >/dev/null