Skip to content

ci: enforce Conventional Commits locally via commit-msg hook - #59

Merged
akshaylive merged 1 commit into
mainfrom
akshaya/conventional_commits
Jul 27, 2026
Merged

ci: enforce Conventional Commits locally via commit-msg hook#59
akshaylive merged 1 commit into
mainfrom
akshaya/conventional_commits

Conversation

@akshaylive

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a commit-msg pre-commit hook (scripts/check_commit_msg.sh) that mirrors the regex in .github/workflows/conventional-commits.yml, rejecting non-conventional commit messages locally before push/CI.
  • Wires default_install_hook_types: [pre-commit, commit-msg] into .pre-commit-config.yaml so make install / pre-commit install sets up both hook types automatically for everyone.

Context: https://github.com/UiPath/coder_eval/actions/runs/30309413197/job/90121301720?pr=58 failed because the PR title/commit message wasn't Conventional-Commits-formatted. The PR-title half of that CI check can't be replicated locally (GitHub only knows the title once the PR exists), but the commit-message half can — and in practice, for single-commit PRs on a squash-merge repo, GitHub defaults the PR title to the commit subject, so keeping commit messages conventional keeps PR titles conventional too.

Test plan

  • uv run pytest -q — 3741 passed, 10 skipped
  • Manually verified the hook fails on the exact bad message from the linked CI run and passes on a conventional one

Mirrors .github/workflows/conventional-commits.yml's commit-message
regex so noncompliant messages are rejected before push instead of
failing in CI (the PR-title half of that check still can't run
locally, since GitHub only knows the title once the PR exists).
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Claude finished @akshaylive's task in 1m 27s —— View job


PR Review: ci: enforce Conventional Commits locally via commit-msg hook

Working on review...

Todo List:

  • Read review guidelines from .github/code_review.md
  • Read project conventions from CLAUDE.md
  • Get full diff (git diff origin/main...HEAD)
  • Read complete changed files for context
  • Review shell script correctness and portability
  • Verify regex consistency with CI configuration
  • Check pre-commit configuration
  • Perform cross-file consistency checks
  • Complete "what's missing" analysis
  • Post comprehensive review feedback

@akshaylive
akshaylive merged commit 5dffc0e into main Jul 27, 2026
15 checks passed
@akshaylive
akshaylive deleted the akshaya/conventional_commits branch July 27, 2026 23:38
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.

2 participants