From 1b60a24547a1a2f2f28bb14db227b62b1d8c4cc7 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 01:47:58 +0000 Subject: [PATCH] Release: a version published by hand is there, not "NOT published" The tag run for 0.1.0 reached its publish step two minutes after the version had been published by hand. npm view still answered 404 - the registry's read side lags a publish by minutes - so the step tried to publish, the registry refused ("cannot publish over the previously published versions: 0.1.0"), and the step fell through to its last branch: a warning that 0.1.0 was NOT published because the package did not exist yet. The run was green, and both claims were wrong. A refusal to publish over an existing version means the version is on the registry, so the step says that and ends. The other outcomes are unchanged: published, a failed publish of a package that exists (an error), and the bootstrap warning for one that does not. Checked with the step's script against a stub npm for each of the four outcomes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018bBcFp146qnMCmXWztQaH8 --- .github/workflows/release.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 887b6fb..158a501 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -90,10 +90,21 @@ jobs: echo "$NAME@$VERSION is already on the registry - nothing to do" exit 0 fi - if npm publish --provenance --access public; then + out="$RUNNER_TEMP/publish.log" + if npm publish --provenance --access public >"$out" 2>&1; then + cat "$out" echo "published $NAME@$VERSION" exit 0 fi + cat "$out" + # npm view lags a publish by minutes: right after the first version + # went out by hand, it still answers 404 while the registry already + # refuses to publish that version again. Measured on 0.1.0: the tag + # run reached this step two minutes after the hand publish. + if grep -q "cannot publish over the previously published version" "$out"; then + echo "$NAME@$VERSION is already on the registry (npm view does not show it yet) - nothing to do" + exit 0 + fi if npm view "$NAME" version >/dev/null 2>&1; then echo "::error::$NAME is on the registry, but publishing $VERSION failed - see the npm output above (the Trusted Publisher not pointing at this repository and release.yml?)" exit 1