Skip to content

ci: delete the staging branch when a preview pull request closes - #10

Merged
tisonkun merged 3 commits into
mainfrom
preview/cleanup-staging
Sep 3, 2026
Merged

ci: delete the staging branch when a preview pull request closes#10
tisonkun merged 3 commits into
mainfrom
preview/cleanup-staging

Conversation

@tisonkun

@tisonkun tisonkun commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

The deploy workflow publishes every preview/<name> build to a generated site/<name>-staging branch, and nothing removed those branches afterwards — three stale staging branches had accumulated, including one from a pull request that was closed unmerged.

This adds a cleanup-staging workflow triggered on pull_request: [closed]: when a same-repo pull request from a preview/<name> branch closes (merged or not), it deletes the matching site/<name>-staging branch. AGENTS.md documents the behavior and the manual cleanup option.

The three existing stale branches (site/docusaurus-staging, site/homepage-staging, site/readme-homepage-staging) have already been deleted as a one-time cleanup.

Design Notes

  • Deleting a staging branch does not unpublish its staged site: the deleted previews kept serving HTTP 200 for 30+ minutes after removal. The workflow therefore only guarantees that deployment output does not accumulate in the repository; staged.apache.org content is pruned by ASF infrastructure on its own schedule (an infra ticket may be needed if stale previews turn out to persist indefinitely).

Staging preview: https://asyncband-cleanup-staging.staged.apache.org/

The deploy workflow publishes every preview/<name> build to a generated
site/<name>-staging branch, and nothing removed those branches or their
staged sites afterwards. Add a cleanup-staging workflow that deletes the
matching site/<name>-staging branch when a preview pull request closes,
whether merged or not, and document the behavior in AGENTS.md.
@tisonkun
tisonkun merged commit 2c20196 into main Sep 3, 2026
2 checks passed
@tisonkun
tisonkun deleted the preview/cleanup-staging branch September 3, 2026 17:15
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