Update safer logic
This commit is contained in:
parent
4c1da506c1
commit
57e9539734
1 changed files with 2 additions and 2 deletions
4
.github/workflows/nightly.yml
vendored
4
.github/workflows/nightly.yml
vendored
|
|
@ -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" \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue