-
Notifications
You must be signed in to change notification settings - Fork 3
/
action.yaml
40 lines (38 loc) · 1.15 KB
/
action.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
29
30
31
32
33
34
35
36
37
38
39
40
name: "Neon Database Delete Branch"
author: "Neon Database"
description: "Deletes Neon Postgres branch with Id"
branding:
icon: "box"
color: "red"
inputs:
project_id:
required: true
description: "The Neon project id"
branch_id:
description: "The Neon branch id"
deprecationMessage: "The `branch_id` input is deprecated in favor of `branch`"
api_key:
description: "The Neon API key, read more at https://neon.tech/docs/manage/api-keys"
required: true
api_host:
description: "The Neon API host"
default: 'https://console.neon.tech/api/v2'
branch:
description: "The Neon branch name or id"
runs:
using: "composite"
steps:
- uses: actions/setup-node@v4
- run: npm i -g neonctl@v2
shell: bash
- name: Delete branch
shell: bash
env:
NEON_API_KEY: ${{ inputs.api_key }}
NEON_API_HOST: ${{ inputs.api_host }}
run: |
if [ -z "${{ inputs.branch }}" ]; then
neonctl branches delete ${{ inputs.branch_id }} --project-id ${{ inputs.project_id }}
else
neonctl branches delete "${{ inputs.branch }}" --project-id ${{ inputs.project_id }}
fi