[CI] Exclude nightly-dev tags from nightly DockerHub cleanup (#55023)
Signed-off-by: khluu <khluu000@gmail.com>
Kevin H. Luu committed
Sep 2, 2026 at 15:09 UTC
963054ed580824e0f3901e3a53f7994349434d13
1 file changed
+3
-1
.buildkite/scripts/cleanup-nightly-builds.sh
+3
-1
@@ -4,6 +4,7 @@ set -ex
4
5
# Clean up old nightly builds from DockerHub, keeping only the last 14 builds
6
# This script uses DockerHub API to list and delete old tags with specified prefix
7
+# Tags starting with "nightly-dev" are always excluded from deletion
8
# Usage: cleanup-nightly-builds.sh [TAG_PREFIX] [REPO]
9
# Example: cleanup-nightly-builds.sh "nightly-"
10
# Example: cleanup-nightly-builds.sh "cu130-nightly-"
@@ -55,7 +56,8 @@ get_all_tags() {
56
set -x
57
58
# Get both last_updated timestamp and tag name, separated by |
58
- local tags=$(echo "$response" | jq -r --arg prefix "$TAG_PREFIX" '.results[] | select(.name | startswith($prefix)) | "\(.last_updated)|\(.name)"')
59
+ # Exclude nightly-dev tags from cleanup
60
+ local tags=$(echo "$response" | jq -r --arg prefix "$TAG_PREFIX" '.results[] | select(.name | startswith($prefix)) | select(.name | startswith("nightly-dev") | not) | "\(.last_updated)|\(.name)"')
61
62
if [ -z "$tags" ]; then
63
break