Skip to content

Commit 7a3501f

Browse files
committed
Retry retag, recheck and possibly fail
1 parent 9ed323f commit 7a3501f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/.pr-close.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,24 @@ jobs:
100100
INSPECT="docker manifest inspect ghcr.io/${{ inputs.organization }}/${{ inputs.repository }}/${{ matrix.package }}"
101101
SOURCE=$(${INSPECT}:${{ inputs.tag_promote }} | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest')
102102
TARGET=$(${INSPECT}:${{ inputs.target }} | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest')
103+
if [ "${SOURCE}" != "${TARGET}" ]; then
104+
echo "ERROR: Tagging failed!"
105+
echo "RETRY=true" >> $GITHUB_ENV
106+
fi
107+
108+
- uses: shrink/actions-docker-registry-tag@v4
109+
if: env.RETRY == 'true'
110+
with:
111+
registry: ghcr.io
112+
repository: ${{ inputs.organization }}/${{ inputs.repository }}/${{ matrix.package }}
113+
target: ${{ inputs.target }}
114+
tags: ${{ inputs.tag_promote }}
115+
116+
- run: |
117+
# Verify tagging after retry
118+
INSPECT="docker manifest inspect ghcr.io/${{ inputs.organization }}/${{ inputs.repository }}/${{ matrix.package }}"
119+
SOURCE=$(${INSPECT}:${{ inputs.tag_promote }} | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest')
120+
TARGET=$(${INSPECT}:${{ inputs.target }} | jq -r '.manifests[] | select(.platform.architecture=="amd64") | .digest')
103121
if [ "${SOURCE}" != "${TARGET}" ]; then
104122
echo "ERROR: Tagging failed!"
105123
exit 1

0 commit comments

Comments
 (0)