Skip to content

ci: retire a pr preview when the pr closes or turns draft - #22

Merged
simonvanlierde merged 2 commits into
mainfrom
ci/retire-previews
Oct 29, 2026
Merged

simonvanlierde merged 2 commits into
mainfrom
ci/retire-previews

Conversation

@simonvanlierde

Copy link
Copy Markdown
Owner

PR previews stayed up after a PR merged or closed. Now a preview only exists while its PR is open and not a draft.

  • A new preview-retire.yml runs when a PR closes or turns draft, and points its pr-N alias at a short "preview closed" page. Wrangler has no command to delete an alias, so this is the closest to removing it.
  • Drafts get no preview, and the checks run again when a draft is marked ready, so the preview appears then.
  • A manual run takes a list of PR numbers, to retire ci: preview each pull request on Cloudflare Workers #21's preview once this merges.

Tests: none yet, since the workflow only runs from main. After merge I'll retire #21 by hand and check that it serves the closed page.

- point the pr-N alias at a short closed page, since wrangler cannot delete an alias
- skip previews for drafts and build one when a draft is marked ready
- let a manual run retire older previews by pr number
@simonvanlierde
simonvanlierde merged commit e81718f into main Oct 29, 2026
7 checks passed
@simonvanlierde
simonvanlierde deleted the ci/retire-previews branch October 29, 2026 13:31

This branch was successfully deployed

1 active deployment
preview — 2a5bf7d4 Deployed Oct 29, 2026 by simonvanlierde via retire #1
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