From 1f818a95d515d8542b89e8dcb431e5333fb93733 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 30 Nov 2026 12:28:57 -0500 Subject: [PATCH] BUG: Skip packages that vanish between listing and cleanup anaconda show can still list a package the API no longer has, such as ci.yml's test-package right after its cleanup removes it. The API then returns an error object, jq fails on .releases[], and since the step now runs with -e (#198) the whole cleanup stops there, skipping every package that sorts after it. Treat a missing releases list as nothing to remove. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/remove-wheels.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/remove-wheels.yml b/.github/workflows/remove-wheels.yml index b5a305b..2b8691c 100644 --- a/.github/workflows/remove-wheels.yml +++ b/.github/workflows/remove-wheels.yml @@ -73,8 +73,10 @@ jobs: echo -e "\n# package: ${package_name}" + # A package deleted since it was listed (like ci.yml's test-package) + # returns an error object with no releases: nothing to remove curl --silent https://api.anaconda.org/package/"${ANACONDA_USER}/${package_name}" | \ - jq -r '.releases[].version' > package-versions.txt + jq -r '.releases[]?.version' > package-versions.txt head --lines "-${N_LATEST_UPLOADS}" package-versions.txt > remove-package-versions.txt for package_version in $(cat package-versions.txt); do