How do I run commitlint on a GitHub pull request message and description? https://github.com/conventional-changelog/commitlint
We currently run commitlint in our CI. However, this is too late in the process i.e. the invalid commit message is already in the branch.
The only approach I've been able to find is with GitHub apps. Below are the apps I've found/tried. Maybe the only solution is to build our own/custom GitHub app? However, linting a GitHub PR seems like a common request and I get the feeling I'm missing something fundamental here.
This GitHub app looks perfect but doesn't currently work: https://github.com/apps/commitlint
This GitHub app allows commit message/description via custom regex. However, I can't find any information as to whether commitlint can be expressed as a single regex statement. https://github.com/marketplace/commit-message-lint
This GitHub app is available for public repos only -- our repo is private. https://github.com/marketplace/commit-lint/plan/MDIyOk1hcmtldHBsYWNlTGlzdGluZ1BsYW4xMjUz#pricing-and-setup
This GitHub app supports multiple regex expressions. https://github.com/ewolfe/prlint
If GitHub apps are not working, you can fallback to a webhook approach, which means having a listener which will respond to a JSON payload sent by GitHub on each push.
That listener could:
At least, a webhook would be run immediately, and not during a CI pipeline.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With