Skip to content

Commit

Permalink
Pipeline - Adding a step to clean up untagged images
Browse files Browse the repository at this point in the history
Fixed: #2337
  • Loading branch information
amankumarrr committed Mar 21, 2024
1 parent 4ed0468 commit 83c8e5c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/pr-close-delete-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ jobs:
Write-Host '❌ Key Vault not found'
}
- name: Delete all untagged images
run: |
$untaggedDigests = az acr manifest list-metadata -r ${{ env.ACR_NAME }} -n `
${{ env.IMAGE_NAME }} --query "[?tags==null].digest" -o tsv | `
%{ az acr repository delete -n ${{ env.ACR_NAME }} -t ${{ env.IMAGE_NAME }}@$_ --yes}
Write-Host "✅ All untagged images have been deleted"
- name: ACR - Delete image
run: |
$imageTagWithPrefix = '${{ env.SLOT_PREFIX }}${{ matrix.SLOT_NAME}}'
Expand Down

0 comments on commit 83c8e5c

Please sign in to comment.