diff --git a/.gitea/workflows/docker.yaml b/.gitea/workflows/docker.yaml index e9f8426..772d895 100644 --- a/.gitea/workflows/docker.yaml +++ b/.gitea/workflows/docker.yaml @@ -57,8 +57,11 @@ jobs: run: | set -x cat /tmp/old_tags | while read TAG; do - echo about to delete $TAG DIGEST=$(curl -u "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASS }}" -sS -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' -o /dev/null -w '%header{Docker-Content-Digest}' https://${{ secrets.REGISTRY_PATH }}/v2/umbrella/manifests/$TAG) - echo digest: $DIGEST - curl -u "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASS }}" -sS -X DELETE https://${{ secrets.REGISTRY_PATH }}/v2/umbrella/manifests/$DIGEST + if [ -n "$DIGEST" ]; then + echo about to delete $TAG + curl -u "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASS }}" -sS -X DELETE https://${{ secrets.REGISTRY_PATH }}/v2/umbrella/manifests/$DIGEST + else + echo failed to get digest for $TAG + fi done