-
-
Notifications
You must be signed in to change notification settings - Fork 4
28 lines (25 loc) · 882 Bytes
/
cleanup.yaml
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
name: Clean up Preview Deployment
on:
pull_request:
types: [closed]
jobs:
delete-preview:
runs-on: ubuntu-latest
if: "!contains(github.head_ref, 'renovate/') || !contains(github.head_ref, 'main')"
steps:
- uses: Infisical/[email protected]
with:
client-id: ${{ secrets.MACHINE_IDENTITY_CLIENT_ID }}
client-secret: ${{ secrets.MACHINE_IDENTITY_CLIENT_SECRET }}
env-slug: "preview"
project-slug: "unprice-zq-xm"
secret-path: "/ci"
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v8
- name: Delete Neon Branch
uses: neondatabase/delete-branch-action@v3
with:
project_id: ${{ env.NEON_PROJECT_ID }}
branch: preview/pr-${{ steps.branch-name.outputs.current_branch }}
api_key: ${{ env.NEON_API_KEY }}