fix(ci): skip no-commit-to-branch for pre-commit run on main#43
Merged
buddingengineers12345 merged 1 commit intomainfrom Apr 17, 2026
Merged
fix(ci): skip no-commit-to-branch for pre-commit run on main#43buddingengineers12345 merged 1 commit intomainfrom
buddingengineers12345 merged 1 commit intomainfrom
Conversation
The hook fails when HEAD is main/master, which breaks lint.yml on push to main and local just check/precommit on main. Set SKIP only for pre-commit run invocations; git commit still runs the hook unless SKIP is exported in the shell. - lint.yml and template ci.yml.jinja: env SKIP on pre-commit step - justfile and template: SKIP on precommit and check recipes - Integration test asserts SKIP in generated ci.yml and justfile Made-with: Cursor
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
no-commit-to-branchcorrectly blocks direct commits tomain/master, but it also runs duringpre-commit run --all-files. When CI checks outmain(e.g. after a merge) or a developer runsjust check/just precommitonmain, that hook fails even though no commit is being made.Changes
ci.yml.jinja: setSKIP: no-commit-to-branchon the Pre-commit (all files) step only.justfile.jinja: prefixprecommitandcheckpre-commit lines withSKIP=no-commit-to-branch.SKIPappears in generatedci.ymlandjustfile.Direct
git commitonmainstill runs the hook unlessSKIPis exported in the shell.Verification
pytest tests/integration/test_template.py::test_ci_workflow_aligns_with_just_ciuv run python scripts/check_root_template_sync.pyjust precommitonmain(hook skipped; other hooks unchanged)Made with Cursor