ci: fix workflow for deleting test env #6
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
name: Remove Review Resources | |
on: | |
pull_request: | |
types: [closed] | |
branches: [main] | |
workflow_dispatch: | |
env: | |
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
RESOURCE_GROUP: rg-bds-test | |
jobs: | |
remove: | |
if: github.actor != 'dependabot[bot]' | |
runs-on: ubuntu-latest | |
name: 🗑️ Remove | |
steps: | |
- name: Azure Login | |
uses: azure/login@v2 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Remove resources from test environment | |
run: | | |
az resource list --resource-group $RESOURCE_GROUP --query "[].id" --output tsv | | |
xargs -I {} az resource delete --ids {} --subscription $AZURE_SUBSCRIPTION_ID |