Skip to content

Commit 27fe2f4

Browse files
committed
delete certificate when PR is closed
1 parent 7493b28 commit 27fe2f4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/pr-cleanup.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Cleanup PR deployment and image
22
on:
33
pull_request:
4-
types: [closed]
4+
types: closed
55
workflow_dispatch:
66
inputs:
77
pr_number:
@@ -63,5 +63,10 @@ jobs:
6363
(
6464
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${{ secrets.PR_DEPLOYMENTS_ZONE_ID }}/dns_records/$record_id" \
6565
-H "Authorization: Bearer ${{ secrets.PR_DEPLOYMENTS_CLOUDFLARE_API_TOKEN }}" \
66-
-H "Content-Type:application/json"
66+
-H "Content-Type:application/json" | jq -r '.success'
6767
) || echo "DNS record not found"
68+
69+
- name: "Delete certificate"
70+
run: |
71+
set -euxo pipefail
72+
kuebctl delete certificate "pr${{ steps.pr_number.outputs.PR_NUMBER }}-tls" -n pr-deployment-certs || echo "certificate not found"

0 commit comments

Comments
 (0)