From 395a7b9f014e840245155c7dd04010b47054fe2a Mon Sep 17 00:00:00 2001 From: ChethanUK Date: Tue, 21 Jul 2026 16:03:06 +0200 Subject: [PATCH] ci(release): skip meta-package publish when the version already exists The platform-package loop guards itself against an already-published version (release.yml:209-215), but the meta package's publish was a bare 'npm publish'. Re-running a successful release - or a publish whose client errored after the registry had already committed the version - fails permanently at that last step with E403. Wrap it in the same guard, reusing the identical log strings so both paths read the same in a release log. Publishing the meta package last is unchanged and still correct. --- .github/workflows/release.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de4de5e5..ca0da62b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -226,6 +226,15 @@ jobs: ' package.json > package.json.tmp && mv package.json.tmp package.json - name: Publish to npm - run: npm publish --access public + run: | + VERSION="${GITHUB_REF_NAME#v}" + pkg_name=$(jq -r '.name' package.json) + already=$(npm view "${pkg_name}@${VERSION}" version 2>/dev/null || true) + if [ "$already" = "$VERSION" ]; then + echo "Skip: ${pkg_name}@${VERSION} already published" + else + npm publish --access public + echo "Published: ${pkg_name}@${VERSION}" + fi env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}