feat: CI safeguards – gate job, auto-merge, pre-commit enforcement#199
Merged
Conversation
…ement
Three complementary mechanisms to prevent "merge and fix later" cycles:
1. pre-commit install enforcement
- Added `pre-commit install` to CONTRIBUTING.md setup (required step)
- ci.yml: added `pre-commit validate-config` step before hook run — catches
typos in hook IDs (e.g. check-merge-conflicts vs check-merge-conflict)
before they silently disable entire hook groups
2. CI Gate job (ci.yml)
- New `gate` job with `if: always()` depending on test + lint + package
- Single required status check for branch protection; stable even when jobs
are renamed — only update `needs:` in the workflow, not GitHub settings
- With "Allow administrators to bypass" unchecked in branch protection,
gh pr merge --admin no longer bypasses lint/test failures
3. Auto-merge bot (.github/workflows/automerge.yml)
- Enables GitHub's native auto-merge (squash) on every non-draft PR
- GitHub merges automatically when CI Gate passes — no manual merge step
- Requires "Allow auto-merge" enabled in repo Settings → General
Documentation: docs/process/ci-safeguards.md (new)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
pre-commit validate-configstep inci.ymllint job — catches hook ID typos before they silently disable hookstest + lint + packagewithif: always(); stable through job renamesautomerge.yml— enables GitHub's native auto-merge on every non-draft PR; merges automatically when gate passesCONTRIBUTING.md—pre-commit installdocumented as required setup stepdocs/process/ci-safeguards.md— full documentation of the three mechanismsNext manual step
In repo Settings → Branches → Branch protection for
main:CI Gateas the required status checkTest plan
CI Gateas required check in branch protection🤖 Generated with Claude Code