forked from PaloAltoNetworks/pan.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 1002 Bytes
/
Copy pathcleanup-preview.yml
File metadata and controls
33 lines (28 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: "Cleanup Preview"
on:
pull_request_target:
types: [closed]
permissions: {}
jobs:
cleanup:
if: github.repository == 'PaloAltoNetworks/pan.dev'
name: Delete preview channel
runs-on: ubuntu-latest
environment: preview
permissions:
id-token: write
steps:
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
with:
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}
- name: Delete Firebase preview channel
run: |
curl -sf -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://firebasehosting.googleapis.com/v1beta1/sites/pan-dev-f1b58/channels/pr${PR_NUMBER}" \
|| echo "Channel pr${PR_NUMBER} not found or already deleted"
env:
PR_NUMBER: ${{ github.event.number }}