_cleanup #2491
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
schedule: | |
- cron: '50 * * * *' | |
workflow_dispatch: | |
name: '_cleanup' | |
jobs: | |
validate: | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: 'azure/login@v2' | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- uses: 'actions/checkout@v3' | |
- run: | | |
for resourceGroup in `az group list --query "[? contains(name,'java-on-azure-')][].{name:name}" -o tsv`; do | |
echo Deleting ${resourceGroup} | |
az group delete -n ${resourceGroup} --yes --no-wait | |
done | |
for resourceGroup in `az group list --query "[? contains(name,'joaz-rg-')][].{name:name}" -o tsv`; do | |
echo Deleting ${resourceGroup} | |
az group delete -n ${resourceGroup} --yes --no-wait | |
done | |
for resourceGroup in `az group list --query "[? contains(name,'joazrg-')][].{name:name}" -o tsv`; do | |
echo Deleting ${resourceGroup} | |
az group delete -n ${resourceGroup} --yes --no-wait | |
done | |
permissions: | |
id-token: write | |
contents: read |