Created
April 7, 2022 08:11
-
-
Save lloydjatkinson/651bbd76c5b7f3540d5a7107918a2f90 to your computer and use it in GitHub Desktop.
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: PR Closed on Development Feature Branch | |
on: | |
pull_request: | |
types: [closed] | |
branches-ignore: | |
- master | |
jobs: | |
delete-infrastructure: | |
name: Delete Infrastructure | |
if: github.head_ref_name != 'development' | |
runs-on: ubuntu-latest | |
env: | |
RESOURCE_GROUP_LOCATION: uksouth | |
steps: | |
- name: Get branch information | |
id: branch-name | |
uses: tj-actions/[email protected] | |
- name: Set additional environment variables | |
run: | | |
echo "RESOURCE_GROUP_NAME=rg-<your project name>-${{ steps.branch-name.outputs.current_branch }}-dev-001" >> "$GITHUB_ENV" | |
- name: Login to Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Delete Azure resource group | |
uses: azure/cli@v1 | |
with: | |
inlineScript: | | |
#!/bin/bash | |
az group delete --name ${{ env.RESOURCE_GROUP_NAME }} --yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment