feat(init): scaffold a report-branch prune job on PR close#162
Merged
Conversation
The scaffolded PR workflow already publishes one pr-<n>/ report folder per
PR to the styleproof-reports branch but never removed them, so the branch
grew without bound — a gap the action.yml doc even called out ("never
pruned"). Now the workflow also triggers on pull_request: closed and runs a
prune job that drops the closing PR's folder (blobless clone → git rm → push);
the report job is unchanged, just guarded to skip the close event. Every
styleproof-init adopter gets bounded report-branch growth out of the box.
Covered by manager-independent assertions in the init workflow test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🗺️ StyleProof report📊 View the side-by-side visual report →To accept: rebuild the map with |
Fallow audit reportNo GitHub PR/MR findings. Generated by fallow. |
Fallow audit report0 inline findings selected for GitHub review. |
…prune # Conflicts: # CHANGELOG.md # package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this gives you
Every StyleProof adopter's report branch now cleans up after itself, with zero manual work. Today
styleproof-initscaffolds a workflow that publishes onepr-<n>/report folder per PR to thestyleproof-reportsbranch — but nothing ever removed them, so the branch grew forever. The Action's own docs admitted it ("never pruned"). After this, when a PR closes, the scaffolded workflow deletes that PR's folder automatically. Bounded growth, out of the box.This is the third and final onboarding bake-in from that dogfood — folding a fix that app had to hand-roll (
styleproof-report-prune.yml) back into the scaffold so no future adopter has to.How
styleproof-init's.github/workflows/styleproof.yml:closed:types: [opened, synchronize, reopened, closed].if: github.event.action != 'closed'— unchanged otherwise.prunejob (if: ... == 'closed') blobless-clones the report branch,git rm -r pr-<n>/, commits, pushes. No-ops cleanly if the branch or folder doesn't exist yet.The Action's
report-branchinput doc is updated (was "never pruned").Verification
test/init.test.mjs— new manager-independent assertions: theclosedtrigger, the report-job guard, theprune:job, and thegit rmline are all present in the generated workflow (8/8 pass).ifguards,${{ }}escaping intact).Merge order
This is 3.16.0. It sits above #161 (3.15.0, canonical value comparison) — please merge #161 first, then this, so the npm release versions land in order. If they merge out of order I'll rebase.
Proof
Not applicable — this changes a CI scaffold (YAML/Node), nothing browser-observable. Behaviour is covered by the init workflow test above.