Update safer logic

This commit is contained in:
Huaaudio 2026-03-09 07:35:12 +01:00
parent 4c1da506c1
commit 57e9539734

View file

@ -197,9 +197,9 @@ jobs:
OLD_NIGHTLY_VERSIONS=$(gh api --paginate -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"$PACKAGE_URL" \
--jq ".[] | select(.metadata.container.tags[] | startswith(\"nightly-\") and (. != \"nightly\") and (. != \"$TAG\")) | .id" 2>/dev/null || true)
--jq ". | map(select(any(.metadata.container.tags[]; startswith(\"nightly-\") and (. != \"nightly\") and (. != \"$TAG\")))) | .[].id" 2>/dev/null || true)
for version_id in $OLD_NIGHTLY_VERSIONS; do
for version_id in $(echo "$OLD_NIGHTLY_VERSIONS" | sort -u); do
if [ -n "$version_id" ]; then
echo "Deleting old nightly Docker image version ID: $version_id"
gh api --method DELETE -H "Accept: application/vnd.github+json" \