Files
docker-check-tag-exists/check.sh
Andreas Rocznik 1050a93015
Some checks failed
Test / test-always-true (push) Failing after 5s
Test / test-always-false (push) Failing after 5s
remove debu output
2023-12-08 20:33:29 +01:00

16 lines
415 B
Bash
Executable File

#!/bin/bash
set -e
CHECK=$( echo -n "$2" | sed -e "s#$1:##g" | jq -R -s 'split("\n")' )
EXISTING=$( skopeo list-tags docker://$1 || echo '{"Tags":[]}' )
TAGS=$( jq '.check - .existing.Tags' <<< "{\"check\": $CHECK, \"existing\": $EXISTING}" )
echo $TAGS | jq '"Tag not found: "+ .[]'
RESULT=$(echo $TAGS | jq '.==[]')
if "$RESULT" == "true"
then
echo "All tags found"
fi
echo exist=$RESULT >> $GITHUB_OUTPUT