Skip to content

Commit e9ea991

Browse files
authored
fix(clean_docker): only fetch up to 10 pages of image versions (#2680)
fix(clean_docker): only fetch upto 10 pages of image versions Signed-off-by: Yinan Qin <elysia-best@simplelinux.cn.eu.org>
1 parent d4aa8b6 commit e9ea991

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/clean_untagged_docker.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ jobs:
102102
TEMP_FILE="/tmp/all_versions.ndjson"
103103
104104
> "$TEMP_FILE"
105-
106-
while [[ -n "$URL" ]]; do
105+
PAGE=1
106+
while [[ -n "$URL" && $PAGE -le 10 ]]; do
107107
echo "Fetching: $URL"
108108
109109
curl -s -H "Authorization: token $TOKEN" \
@@ -114,6 +114,7 @@ jobs:
114114
jq -c '.[]' page.json >> "$TEMP_FILE"
115115
116116
URL=$(grep -i '^link:' headers.txt | grep -o '<[^>]*>;\s*rel="next"' | sed 's/<\(.*\)>.*/\1/' || true)
117+
PAGE=$((PAGE + 1))
117118
done
118119
rm -f headers.txt page.json
119120

0 commit comments

Comments
 (0)