fix: tidy up in workflow merge step
This commit is contained in:
parent
e7cd8d4d68
commit
ddbffee4ae
2 changed files with 10 additions and 8 deletions
|
|
@ -148,10 +148,11 @@ jobs:
|
|||
|
||||
- name: Delete intermediate platform tags
|
||||
run: |
|
||||
CACHE_ENCODED=$(echo "${{ env.CACHE_IMAGE }}" | sed 's|/|%2F|g')
|
||||
CACHE_NAME="${{ env.CACHE_IMAGE }}"
|
||||
CACHE_NAME="${CACHE_NAME##*/}"
|
||||
for tag in platform-semantic-amd64 platform-semantic-arm64; do
|
||||
curl -s -X DELETE \
|
||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE \
|
||||
-H "Authorization: token ${{ secrets.REGISTRY_TOKEN }}" \
|
||||
"https://${{ env.REGISTRY }}/api/v1/packages/${{ github.repository_owner }}/container/${CACHE_ENCODED}/${tag}" \
|
||||
&& echo "Deleted ${tag}" || echo "Failed to delete ${tag} (ignored)"
|
||||
"https://${{ env.REGISTRY }}/api/v1/packages/${{ github.repository_owner }}/container/${CACHE_NAME}/${tag}")
|
||||
echo "DELETE ${tag}: HTTP ${STATUS}"
|
||||
done
|
||||
|
|
|
|||
|
|
@ -138,10 +138,11 @@ jobs:
|
|||
|
||||
- name: Delete intermediate platform tags
|
||||
run: |
|
||||
IMAGE_ENCODED=$(echo "${{ env.IMAGE_NAME }}" | sed 's|/|%2F|g')
|
||||
PACKAGE_NAME="${{ env.IMAGE_NAME }}"
|
||||
PACKAGE_NAME="${PACKAGE_NAME##*/}"
|
||||
for tag in platform-amd64 platform-arm64; do
|
||||
curl -s -X DELETE \
|
||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE \
|
||||
-H "Authorization: token ${{ secrets.REGISTRY_TOKEN }}" \
|
||||
"https://${{ env.REGISTRY }}/api/v1/packages/${{ github.repository_owner }}/container/${IMAGE_ENCODED}/${tag}" \
|
||||
&& echo "Deleted ${tag}" || echo "Failed to delete ${tag} (ignored)"
|
||||
"https://${{ env.REGISTRY }}/api/v1/packages/${{ github.repository_owner }}/container/${PACKAGE_NAME}/${tag}")
|
||||
echo "DELETE ${tag}: HTTP ${STATUS}"
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue