Skip to content

Commit

Permalink
Pipeline - Adding a step to clean up untagged images (#2342)
Browse files Browse the repository at this point in the history
* Pipeline - Adding a step to clean up untagged images

Fixed: #2337

* Fixing it to suggested format
  • Loading branch information
amankumarrr committed Mar 21, 2024
1 parent 4ed0468 commit 75731cb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/pr-close-delete-env.yml
Expand Up @@ -114,6 +114,21 @@ jobs:
Write-Host '❌ Key Vault not found'
}
- name: Delete all untagged images
run: |
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 75731cb

Please sign in to comment.