Skip to content

Commit 0fa396e

Browse files
committed
chore: add Neon database branching workflow for PRs
1 parent 6d83b26 commit 0fa396e

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Neon Database Branching
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, closed]
6+
7+
jobs:
8+
setup-neon-branch:
9+
if: github.event.action != 'closed'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Create Neon Branch
13+
uses: neondatabase/create-branch-action@v5
14+
with:
15+
project_id: ${{ vars.NEON_PROJECT_ID }}
16+
branch_name: preview/pr-${{ github.event.number }}
17+
api_key: ${{ secrets.NEON_API_KEY }}
18+
19+
delete-neon-branch:
20+
if: github.event.action == 'closed'
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Delete Neon Branch
24+
uses: neondatabase/delete-branch-action@v3
25+
with:
26+
project_id: ${{ vars.NEON_PROJECT_ID }}
27+
branch: preview/pr-${{ github.event.number }}
28+
api_key: ${{ secrets.NEON_API_KEY }}

0 commit comments

Comments
 (0)