Skip to content

feat(init): scaffold a report-branch prune job on PR close#162

Merged
BenSheridanEdwards merged 2 commits into
mainfrom
feat/scaffold-report-prune
Jul 5, 2026
Merged

feat(init): scaffold a report-branch prune job on PR close#162
BenSheridanEdwards merged 2 commits into
mainfrom
feat/scaffold-report-prune

Conversation

@BenSheridanEdwards

@BenSheridanEdwards BenSheridanEdwards commented Jul 5, 2026

Copy link
Copy Markdown
Owner

What this gives you

Every StyleProof adopter's report branch now cleans up after itself, with zero manual work. Today styleproof-init scaffolds a workflow that publishes one pr-<n>/ report folder per PR to the styleproof-reports branch — 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:

  • Trigger gains closed: types: [opened, synchronize, reopened, closed].
  • The existing report job is guarded if: github.event.action != 'closed' — unchanged otherwise.
  • A new prune job (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-branch input doc is updated (was "never pruned").

Verification

  • test/init.test.mjs — new manager-independent assertions: the closed trigger, the report-job guard, the prune: job, and the git rm line are all present in the generated workflow (8/8 pass).
  • Generated YAML validated with a real parser (both jobs, correct if guards, ${{ }} escaping intact).
  • Full pre-commit gate green: build, typecheck, lint, format, fallow audit.

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.

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>
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

🗺️ StyleProof report

📊 View the side-by-side visual report →


To accept: rebuild the map with styleproof-map, then rerun the report.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Fallow audit report

No GitHub PR/MR findings.

Generated by fallow.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Fallow audit report

0 inline findings selected for GitHub review.

…prune

# Conflicts:
#	CHANGELOG.md
#	package.json
@BenSheridanEdwards BenSheridanEdwards merged commit 810ebc6 into main Jul 5, 2026
7 checks passed
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