File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,25 @@ jobs:
4343 echo "Deleting the following tags:"
4444 echo "$TO_DELETE" | awk '{print $2}'
4545
46+ FAILED_DELETIONS=""
4647 while read -r line; do
4748 id=$(echo "$line" | awk '{print $1}')
4849 tag=$(echo "$line" | awk '{print $2}')
4950 echo "Deleting tag $tag (version ID $id)"
50- gh api -X DELETE -H "Accept: application/vnd.github+json" \
51- /orgs/${{ env.ORG }}/packages/container/${{ env.IMAGE_NAME }}/versions/$id || echo "Failed to delete version $id ($tag)"
51+ if ! gh api -X DELETE -H "Accept: application/vnd.github+json" \
52+ /orgs/${{ env.ORG }}/packages/container/${{ env.IMAGE_NAME }}/versions/$id; then
53+ echo "Failed to delete version $id ($tag)"
54+ FAILED_DELETIONS="${FAILED_DELETIONS}\n$id ($tag)"
55+ fi
56+ echo "Failed to delete version $id ($tag)"
57+ FAILED_DELETIONS="${FAILED_DELETIONS}\n$id ($tag)"
58+ fi
5259 done <<< "$TO_DELETE"
5360
61+ if [ -n "$FAILED_DELETIONS" ]; then
62+ echo -e "The following deletions failed:\n$FAILED_DELETIONS"
63+ exit 1
64+ fi
5465 - name : List remaining ${{ env.TAG_PREFIX }}* tags and their version IDs (debug)
5566 run : |
5667 gh api -H "Accept: application/vnd.github+json" \
You can’t perform that action at this time.
0 commit comments