diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 68e00a194..87b5e5cfd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -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" \