You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a PR is created with a commit message of around 72 characters the commitlint action will pass. But when the PR is Squashed and Merged Github appends the PR number in the commit message. The appended commit message fails the commitlint after the PR is merged. https://github.com/opensource-nepal/node-nepali-datetime/actions/runs/11974343317
To Reproduce
Pre-requisite: Github Action is set up on the target branch with pull_request and push events.
Create a PR with a commit message of 72 characters.
The commitlint will pass.
Squash and merge the PR.
Leave the commit message GitHub suggests (PR number appended to the commit message).
The commitlint fails after the PR is merged as the commit message length exceeds 72 characters.
Expected behavior
The commitlint should be smart enough to overcome this situation.
Possible Solution:
Ignore the appended PR number; common formats ... (#PR) and ... #PR.
Environment
Python version: N/A
Package version: v1.3.0
Operating system: Github Actions
Any other relevant information about your environment.
I think it should have an option to bypass the 72-character limit, and even configure the length. The length limit is not even on the conventional commit spec.
I think it should have an option to bypass the 72-character limit, and even configure the length. The length limit is not even on the conventional commit spec.
True, the length check should be optional and limit should be configurable.
Hello @SiegeSailor,
Auto-generated commits (such as merge, revert, etc.) are skipped by commitlint. However, squash commits are not skipped. We need to update the squash commit message if it doesn’t follow the conventional commit standard. This will help maintain consistency in the repository’s commit history.
Did you manually change the merge commit message to bypass the commitlint?
For this, we have added commitlint to PRs as well, so the squash commit messages are usually in the correct format. We do not modify the commit messages.
Hello @aj3sh, thank you for your prompt reply. Sorry, I must have overlooked the error message:
⧗ ci: update action secrets
Commit validation: successful!
⧗ 1.0.0-release.7
Error: ✖ Found 1 error(s).
- Commit message does not follow the Conventional Commits format.
⧗ docs: update dependencies format
Commit validation: successful!
⧗ Merge pull request #1 from SiegeSailor/release
Commit validation: successful!
Error: Process completed with exit code 1.
The failure was actually caused by 1.0.0-release.7, which is an auto-generated commit message by Python Semantic Release. While the auto-generated commit format is configurable (I believe) in PSR, is there a way for commitlint to ignore certain committers? (for example, github-actions)? If this is not here yet but is desired, I can create a PR for this.
Activity
kiyoon commentedon Nov 27, 2024
I think it should have an option to bypass the 72-character limit, and even configure the length. The length limit is not even on the conventional commit spec.
aj3sh commentedon Nov 27, 2024
True, the length check should be optional and limit should be configurable.
SiegeSailor commentedon Nov 5, 2025
Hello @aj3sh, unrelated question. Did you manually change the merge commit message to bypass the commitlint? My action https://github.com/SiegeSailor/Smarty-Notebook/actions/runs/19092271540 failed due to the default merge commit message, and I was looking for an option to ignore the merge and squash commit messages.
aj3sh commentedon Nov 6, 2025
Hello @SiegeSailor,
Auto-generated commits (such as merge, revert, etc.) are skipped by commitlint. However, squash commits are not skipped. We need to update the squash commit message if it doesn’t follow the conventional commit standard. This will help maintain consistency in the repository’s commit history.
For this, we have added commitlint to PRs as well, so the squash commit messages are usually in the correct format. We do not modify the commit messages.
SiegeSailor commentedon Nov 8, 2025
Hello @aj3sh, thank you for your prompt reply. Sorry, I must have overlooked the error message:
The failure was actually caused by
1.0.0-release.7, which is an auto-generated commit message by Python Semantic Release. While the auto-generated commit format is configurable (I believe) in PSR, is there a way forcommitlintto ignore certain committers? (for example,github-actions)? If this is not here yet but is desired, I can create a PR for this.aj3sh commentedon Nov 9, 2025
Hi @SiegeSailor,
commitlintdoesn’t have a feature to ignore specific committers. The logic for handling committers hasn’t been implemented in its source code, and I’d prefer not to introduce it unless absolutely necessary. It would be better if we configure the commit format in Python Semantic Release instead; https://python-semantic-release.readthedocs.io/en/latest/configuration/configuration.html#commit-message.Another option would be to introduce a custom ignore patterns (perhaps from some ignore file).
SiegeSailor commentedon Nov 9, 2025
Hello @aj3sh, I ended up with something like below in my
releaserc.tomlfor PSR (see python-semantic-release/python-semantic-release#187 (comment) for details):I am not sure how a custom ignore pattern works here. Let me dive deeper into the whole commit linting and automation ecosystem and come back later.
aj3sh commentedon Nov 9, 2025
This looks great.
The custom ignore pattern hasn't been implemented in commitlint yet.