Repository navigation
#150 — harden pr-preview cleanup commit guard (explicit staged-check) - #151
Conversation
The pr-preview-cleanup workflow (and the mirrored recipe §8) used `git commit … || exit 0`, which ends green when nothing is staged — but also masks a *genuine* commit failure (hook/config error), silently leaving a stale pr-<N>/ preview dir behind. Replace with an explicit `git diff --cached --quiet` staged-changes check: skip cleanly when the preview dir was already absent, but let a real commit failure surface red. Kept the dogfood workflow and the consumer recipe snippet in sync (dogfood ≡ recipe). actionlint + shellcheck clean. Closes #150 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Ready to review this PR? Stage has broken it down into 2 individual chapters for you:
Chapters generated by Stage for commit ad36175 on Jun 8, 2026 1:38am UTC. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR hardens the PR preview cleanup workflow and its recipe by replacing conditional commit failure suppression with an explicit staged-changes guard. Both ChangesCleanup commit guard hardening
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the GitHub Actions PR review recipe in the documentation. It replaces the git commit ... || exit 0 command with an explicit check for staged changes using git diff --cached --quiet to avoid silently masking genuine commit failures. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
📄 Rendered report previewAll golden examples regenerated cleanly. 🟡 Golden examplesCommitted to
🐶 Live dogfood previewThis PR doesn't touch ▶ Open ↗ opens the report in your browser in one click — The Pages preview may take ~1 min to update after this comment Alternative: GitHub CLI# gh CLI >= 2.63 extracts into ./report-preview-playground/.
gh run download 27111264353 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.htmlPosted by |
Summary
pr-preview-cleanup.yml(and the mirrored consumer recipe §8) ended thecleanup with
git commit … || exit 0. That swallows the intended no-op(nothing staged when the
pr-<N>/dir was already absent) — but it alsoswallows a genuine commit failure (a hook or git-config error), silently
leaving a stale preview dir behind. gemini-code-assist flagged this on PR #149.
Change
Replace
|| exit 0with an explicit staged-changes check, in both thedogfood workflow and the recipe snippet (kept in sync — dogfood ≡ recipe):
Already-absent dir → skip cleanly (green). A real commit failure now surfaces
red instead of being masked into a silent stale-dir.
Validation
actionlintclean (it runs the bundledshellcheckon therun:block).shellcheckclean on the extracted script.ci:prefix (no version bump).Do not merge — Christopher's call.
Closes #150
🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Documentation