dist-tag 検証をリトライ付きに変更(npm レジストリの結果整合性対策)
This commit is contained in:
parent
f8fe5f69d2
commit
a50687a055
24
.github/workflows/auto-tag.yml
vendored
24
.github/workflows/auto-tag.yml
vendored
@ -86,13 +86,21 @@ jobs:
|
|||||||
- name: Verify dist-tags
|
- name: Verify dist-tags
|
||||||
run: |
|
run: |
|
||||||
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
||||||
LATEST=$(npm view "${PACKAGE_NAME}" dist-tags.latest)
|
|
||||||
NEXT=$(npm view "${PACKAGE_NAME}" dist-tags.next || true)
|
|
||||||
|
|
||||||
echo "latest=${LATEST}"
|
for attempt in 1 2 3 4 5; do
|
||||||
echo "next=${NEXT}"
|
LATEST=$(npm view "${PACKAGE_NAME}" dist-tags.latest)
|
||||||
|
NEXT=$(npm view "${PACKAGE_NAME}" dist-tags.next || true)
|
||||||
|
|
||||||
if [ "${{ steps.npm-tag.outputs.tag }}" = "latest" ] && [ "${LATEST}" != "${NEXT}" ]; then
|
echo "Attempt ${attempt}: latest=${LATEST}, next=${NEXT}"
|
||||||
echo "Expected next to match latest on stable release, but they differ."
|
|
||||||
exit 1
|
if [ "${{ steps.npm-tag.outputs.tag }}" != "latest" ] || [ "${LATEST}" = "${NEXT}" ]; then
|
||||||
fi
|
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