Skip to content

ci: prune verified merged PR heads, preserve release and active branches - #336

Open
turinglambdaai wants to merge 1 commit into
mainfrom
ci/verified-merged-branch-pruning-20261027
Open

turinglambdaai wants to merge 1 commit into
mainfrom
ci/verified-merged-branch-pruning-20261027

Conversation

@turinglambdaai

Copy link
Copy Markdown
Owner

Purpose

The owner has explicitly requested deletion of obsolete topic branches in all repositories, keeping default and active development branches. This PR adds a Rivet-only, GitHub-native workflow using this repo's default token—no global PAT, no source checkout, no Racket or native product behavior changes.

Exactly what may be deleted

A remote branch can be pruned only when (1) not the default/protected branch, (2) does not have any open PR, (3) not a release/deployment/upstream/history name, (4) one merged same-repository PR has the exact current head SHA for that named branch, (5) a fresh head/protection/open-PR recheck agrees. Unknown/unmerged/divergent/continued-development heads remain.

The initial merge triggers the workflow (push to main with workflow path); subsequent merged PRs retrigger it. GitHub API does not offer atomic compare/delete, and workflow documents the small remaining race window. CI failing to get contents:write will leave branches intact, which must be reported.

Source reviewed from site merged PR #11, already deployed on a site repo where only default branch remains. Rivet baseline main@9de6f5a76991bf30f0e2b5890856e62a8493ad29, after verified merges of #335/#334/#331. No PR checks bypassed; requires full current-head six-workflow CI before merge. No claim of deleted Rivet refs until its cleanup run succeeds and the remote listing changes.

Tracks portfolio branch hygiene issue #10.

This branch has not been deployed

No deployments
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