How do you enforce Conventional Commit format without a local hook?
BeginnerScenarioProtection, Hooks and Policy
Answer
Situation read → Enforcement must work for everyone and survive squash merging.
What I'd do →
- Add a PR title check in CI, for example
amannn/action-semantic-pull-request. - Make it a required check.
- Configure the repo to use "Pull request title" for squash commit messages.
- Optionally run commitlint for repos that use merge or rebase.
Why → The squash commit message is what lands in history, and it comes from the PR title.
Interview tip → Validate where the message is born, not where it is typed.
More on Protection, Hooks and Policy
You are asked to protect `main`. Which rules do you turn on?BeginnerClassic branch protection or repository rulesets: which do you use?IntermediateA required status check never reports and the PR is stuck as "Expected — Waiting for status".IntermediateProduction is down and the fix needs to merge now, but approvals are required.IntermediateYou want to stop developers from committing obvious mistakes like debug prints, trailing whitespace or secrets.BeginnerHooks in `.git/hooks` are not shared with the team. How do you distribute them?Intermediate