Skip to content

Commit 51692eb

Browse files
committed
fix: handle repos with no tags
1 parent d690347 commit 51692eb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dc/registry_delete.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ function validate_image_tag() {
4141
# Delete images older than DELETE_SINCE_DAYS and exit 0
4242
if [ -n "$DELETE_SINCE_DAYS" ]; then
4343
echo "::notice::Deleting images older than $DELETE_SINCE_DAYS days"
44-
repo_tags=$(curl -s -u $HTTPS_USERNAME https://$REGISTRY_URL/v2/$GITHUB_OWNER/$APP_NAME/tags/list | jq -r '.tags[]')
44+
repo_tags=$(curl -s -u $HTTPS_USERNAME https://$REGISTRY_URL/v2/$GITHUB_OWNER/$APP_NAME/tags/list | jq -r '.tags[]?')
45+
if [ -z "$repo_tags" ]; then
46+
echo "::warning::No images found for $APP_NAME"
47+
exit 0
48+
fi
49+
4550
while IFS= read -r tag; do
4651
manifest=$(curl -s -u $HTTPS_USERNAME \
4752
-H "Accept: application/vnd.docker.distribution.manifest.v2+json" \

0 commit comments

Comments
 (0)