Skip to content

fix: prevent obsolete Neon previews from accumulating - #9

Closed
dakdevs wants to merge 1 commit into
mainfrom
fix/neon-preview-cleanup
Closed

dakdevs wants to merge 1 commit into
mainfrom
fix/neon-preview-cleanup

Conversation

@dakdevs

@dakdevs dakdevs commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Why

Closed pull requests can leave billable Neon preview branches until Vercel deletes their last deployment.

Evidence: Neon’s Vercel cleanup documentation describes deployment-based retention; this repository is connected to Neon project frosty-mouse-25883459.

Fix: Run repository-owned cleanup when a PR closes or merges. The exact preview database is deleted only after live ownership and safety checks; old preview URLs then lose their database.

Changes

  • Protect default, protected, permanent, parent, open-PR, fork, and reused branches; recheck immediately before deleting and verify absence afterward.
  • Execute trusted default-branch code with read-only GITHUB_TOKEN, an encrypted NEON_API_KEY, pinned actions, and no application dependency installation.
  • Add manual dry-run/recovery for already-closed PRs, isolated unit/HTTP tests, and native-expiration instructions for branches without PRs.

Validation

In .github/neon-cleanup: bun run lint, bun run prettier, bun test (24 passed), and bun run test:e2e (9 passed). Live read-only checks also matched stale previews in Shows, Technight, and MyAion.

Repository-wide checks are not certified: bun run lint, bun run typecheck, bun run test:e2e could not complete in the fresh checkout with application dependencies/services unavailable. The dedicated cleanup CI validates the changed subsystem. No application code changed.

Activation

NEON_API_KEY is provisioned. Automatic cleanup starts after merging into main. Already-closed PRs require a manual run; ambiguous branches remain for review. The old central scheduled workflow is disabled and its Neon secret has been removed.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Signed-off-by: Dak Washbrook <hey@dak.dev>
@vercel

vercel Bot commented Oct 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
hooky Ready Ready Preview Oct 8, 2026 5:57am UTC

Request Review

@dakdevs dakdevs closed this Oct 8, 2026

This branch was successfully deployed

1 active deployment
Preview — c4becfcb Deployed Oct 8, 2026 by vercel[bot]
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