-
Notifications
You must be signed in to change notification settings - Fork 92
30 lines (29 loc) · 1018 Bytes
/
clean-acr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Clean Azure Container Registry
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * MON"
jobs:
clean:
runs-on: ubuntu-latest
steps:
- name: Disable workflow
run: |
curl -X PUT -H "Authorization: token ${{ secrets.APK_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.APK_BOT_TOKEN }}" \
https://api.github.com/repos/wso2/apk/actions/workflows/49589306/enable