dist-tag 検証をリトライ付きに変更(npm レジストリの結果整合性対策)
This commit is contained in:
parent
f8fe5f69d2
commit
a50687a055
18
.github/workflows/auto-tag.yml
vendored
18
.github/workflows/auto-tag.yml
vendored
@ -86,13 +86,21 @@ jobs:
|
||||
- name: Verify dist-tags
|
||||
run: |
|
||||
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
||||
|
||||
for attempt in 1 2 3 4 5; do
|
||||
LATEST=$(npm view "${PACKAGE_NAME}" dist-tags.latest)
|
||||
NEXT=$(npm view "${PACKAGE_NAME}" dist-tags.next || true)
|
||||
|
||||
echo "latest=${LATEST}"
|
||||
echo "next=${NEXT}"
|
||||
echo "Attempt ${attempt}: latest=${LATEST}, next=${NEXT}"
|
||||
|
||||
if [ "${{ steps.npm-tag.outputs.tag }}" = "latest" ] && [ "${LATEST}" != "${NEXT}" ]; then
|
||||
echo "Expected next to match latest on stable release, but they differ."
|
||||
exit 1
|
||||
if [ "${{ steps.npm-tag.outputs.tag }}" != "latest" ] || [ "${LATEST}" = "${NEXT}" ]; then
|
||||
echo "Dist-tags verified."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$attempt" -eq 5 ]; then
|
||||
echo "::warning::dist-tags not synced after 5 attempts (latest=${LATEST}, next=${NEXT}). Registry propagation may be delayed."
|
||||
exit 0
|
||||
fi
|
||||
sleep $((attempt * 10))
|
||||
done
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user