Skip to content

feat: event 45 + post event #68

feat: event 45 + post event

feat: event 45 + post event #68

Workflow file for this run

name: Delete env for branch
on:
# Dès qu'une pull request est fermée on déclenche le workflow
pull_request:
types: [closed]
jobs:
delete_env:
name: Delete site in Netlify for the branch
runs-on: ubuntu-latest
steps:
# Suppression du site correspondant au nom de la branche ciblée par la PR
- name: Delete site for branch
run: |
SITE_ID=$(curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer ${{ secrets.NETLIFY_AUTH_TOKEN }}" https://api.netlify.com/api/v1/sites?name=${{github.head_ref}} | jq --raw-output '.[0].id')
curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Bearer ${{ secrets.NETLIFY_AUTH_TOKEN }}" https://api.netlify.com/api/v1/sites/$SITE_ID