Skip to content

build(deps): bump jinja2 from 3.1.2 to 3.1.3 in /validator #112

build(deps): bump jinja2 from 3.1.2 to 3.1.3 in /validator

build(deps): bump jinja2 from 3.1.2 to 3.1.3 in /validator #112

name: Delete Neon Branch
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
pull_request:
types:
- closed
paths-ignore:
- '*.md'
workflow_dispatch:
jobs:
delete-neon-branch:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Search branch by name
id: get_branch_id
# list all branches and filter by name
run: |
branch_id=$(curl --silent \
"https://console.neon.tech/api/v2/projects/${{ secrets.NEON_PROJECT_ID }}/branches" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${{ secrets.NEON_API_KEY }}" \
| jq -r .branches \
| jq -c '.[] | select(.name | contains("'${{ github.event.pull_request.head.ref || github.head_ref }}'")) .id' \
| jq -r)
echo "branch_id=${branch_id}" >> $GITHUB_OUTPUT
- name: Delete Neon Branch
uses: neondatabase/delete-branch-action@v2
with:
project_id: ${{ secrets.NEON_PROJECT_ID }}
branch_id: ${{ steps.get_branch_id.outputs.branch_id }}
api_key: ${{ secrets.NEON_API_KEY }}