fail-proofing tag deletion
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user