Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

don't fail if an npm publish attempt is for an existing version. (#12044)

iceweasel-oaic4bb7db15951
diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml
index 30090089c6..e7fc2c5ef2 100644
--- a/.github/workflows/rust-release.yml
+++ b/.github/workflows/rust-release.yml
@@ -611,7 +611,22 @@ jobs:
fi
echo "+ ${publish_cmd[*]}"
- "${publish_cmd[@]}"
+ set +e
+ publish_output="$("${publish_cmd[@]}" 2>&1)"
+ publish_status=$?
+ set -e
+
+ echo "${publish_output}"
+ if [[ ${publish_status} -eq 0 ]]; then
+ continue
+ fi
+
+ if grep -qiE "previously published|cannot publish over|version already exists" <<< "${publish_output}"; then
+ echo "Skipping already-published package version for ${filename}"
+ continue
+ fi
+
+ exit "${publish_status}"
done
update-branch: