Skip to content

Add docs preview cleanup on PR close#16

Open
dcmcand wants to merge 1 commit into
mainfrom
docs-preview-cleanup
Open

Add docs preview cleanup on PR close#16
dcmcand wants to merge 1 commit into
mainfrom
docs-preview-cleanup

Conversation

@dcmcand

@dcmcand dcmcand commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Adds .github/workflows/docs-preview-cleanup.yml: when a PR closes (merged or not), it deletes that branch's Cloudflare Pages preview deployments via the Pages API (filtered to env=preview, matched by deployment_trigger.metadata.branch, deleted with force=true).

Direct Upload deploys (wrangler pages deploy) are not tied to the git branch lifecycle, so without this, preview deployments linger after the branch is gone. Scoped per PR: it only removes the closing PR's own branch previews, never another open PR's, and never production. Fork PRs are skipped (no preview, no secrets).

README updated so packs adopting docs copy this workflow alongside docs.yml and set CF_PROJECT.

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