Skip to content

Commitlint fails after squash merge #67

Open
@aj3sh

Description

@aj3sh

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
Screenshot 2024-11-22 at 8 42 35 PM

To Reproduce
Pre-requisite: Github Action is set up on the target branch with pull_request and push events.

  1. Create a PR with a commit message of 72 characters.
  2. The commitlint will pass.
  3. Squash and merge the PR.
  4. Leave the commit message GitHub suggests (PR number appended to the commit message).
  5. 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions