Skip to content

Clean Azure Container Registry #24

Clean Azure Container Registry

Clean Azure Container Registry #24

Workflow file for this run

name: Clean Azure Container Registry
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * MON"
env:
GH_TOKEN: ${{ secrets.WSO2_BOT_TOKEN }}
jobs:
clean:
runs-on: ubuntu-latest
steps:
- name: Disable workflow
run: |
curl -X PUT -H "Authorization: token ${{ secrets.WSO2_BOT_TOKEN }}" \
https://api.github.com/repos/wso2/apk/actions/workflows/49589306/disable
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Login to AZURE AND DELETE
uses: azure/CLI@v1
with:
azcliversion: 2.44.1
inlineScript: |
for repo in $(az acr repository list --name ${{ secrets.AZURE_ACR_NAME }} --output tsv); do
az acr repository delete --name ${{ secrets.AZURE_ACR_NAME }} --repository $repo --yes
done
- name: Enable workflow
if: always()
run: |
curl -X PUT -H "Authorization: token ${{ secrets.WSO2_BOT_TOKEN }}" \
https://api.github.com/repos/wso2/apk/actions/workflows/49589306/enable