A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://stackoverflow.com/questions/78649284/commitizen-how-to-run-commit-check-in-gitlab-ci below:

commitizen - how to run commit check in gitlab ci

your command works great for pre-commit / pre-push style hooks -- but commitizen is a commit-msg hook so you have to adjust the command (and approach) significantly

first you sort of have to understand how pre-commit calls commit-msg hooks in the first place. git places a file on disk (usually .git/COMMIT_MSG) and then pre-commit passes that filename along to tools.

in order to replicate that in CI, you need to write out files for each commit message you want to test, and then run each of those through pre-commit with a command similar to:

# assume you wrote the commit messages into this directory
find commit-msgs -type f -print0 | xargs -0 -I{} pre-commit run --commit-msg-filename {} --hook-stage commit-msg

disclaimer: I wrote pre-commit


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4