Skip to content

Pr cleanup

Pr cleanup #1

Workflow file for this run

# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Destroy PR
on:
pull_request:
types: [closed]
branches: master
env:
AZURE_WEBAPP_NAME: gccollab-dev-pr-${{ github.event.number }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
SECRET_NAME: PR_${{ github.event.number }}
jobs:
azure:
name: Delete Azure Resources
runs-on: ubuntu-latest
steps:
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Delete Resources
uses: azure/CLI@v1
with:
azcliversion: 2.30.0
inlineScript: az group delete --name ${{ env.AZURE_WEBAPP_NAME }}
secret:
name: Delete GitHub Secret
runs-on: ubuntu-latest
steps:
- name: GitHub Auth Login
shell: bash
run: gh auth login --with-token <<< ${{ env.ACCESS_TOKEN }}
- uses: actions/checkout@master
- name: Delete Secret
run: gh secret delete "${{ env.SECRET_NAME }}"
environment:
name: Delete GitHub Environment
runs-on: ubuntu-latest
steps:
- name: Delete Environment
shell: bash
run: |
curl -X DELETE "https://api.github.com/repos/gctools-outilsgc/gccollab-frontend/environments" \
-H "Authorization: token ${{ env.ACCESS_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json"