chore(ci): delete Neon preview branch when PR closes - #94
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
.github/workflows/cleanup-neon-preview-branch.yml. Onpull_request: closed(merged or not), deletes the Neon branchpreview/<git-branch>vianeondatabase/delete-branch-action@v3.Why
The Neon<->Vercel integration creates a
preview/<git-branch>DB branch for everyapps/cmspreview 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_TOKENneeds no scopes.pull_requestruns 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 arun:block.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. Becausepull_requestworkflows 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.