Skip to content

chore(ci): delete Neon preview branch when PR closes - #94

Merged
dogfrogfog merged 1 commit into
mainfrom
feature/add-action-to-cleanup-neondb-branch
Aug 6, 2026
Merged

chore(ci): delete Neon preview branch when PR closes#94
dogfrogfog merged 1 commit into
mainfrom
feature/add-action-to-cleanup-neondb-branch

Conversation

@dogfrogfog

Copy link
Copy Markdown
Member

What

Adds .github/workflows/cleanup-neon-preview-branch.yml. On pull_request: closed (merged or not), deletes the Neon branch preview/<git-branch> via neondatabase/delete-branch-action@v3.

Why

The Neon<->Vercel integration creates a preview/<git-branch> DB branch for every apps/cms preview deployment but never removes it. Stale branches accumulate storage cost. Plugin-only PRs also get a preview deploy, so this applies repo-wide — no path filter needed.

Notes

  • permissions: {} — the action only talks to the Neon API, GITHUB_TOKEN needs no scopes.
  • Skips fork PRs: secrets aren't exposed to pull_request runs from forks, so the step would fail on every external PR. It also avoids passing an untrusted branch name into the action, which interpolates it straight into a run: block.
  • Reads secrets.NEON_PROJECT_ID + secrets.NEON_API_KEY (both already set on this repo).

Verification

preview/<git-branch> naming is not yet confirmed against the console. Because pull_request workflows run from the PR head, closing this PR exercises the workflow itself — that run is the test. If the prefix is wrong the job fails visibly and it's a one-line change.

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
turbo-cms-kit-payload Ready Ready Preview Aug 6, 2026 1:22pm

Request Review

@dogfrogfog
dogfrogfog merged commit b74bf7f into main Aug 6, 2026
2 checks passed
@dogfrogfog
dogfrogfog deleted the feature/add-action-to-cleanup-neondb-branch branch August 6, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant