Skip to content

Commitlint fails after squash merge #67

@aj3sh

Description

@aj3sh
Member

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.

Activity

added
bugSomething isn't working
help wantedExtra attention is needed
on Nov 23, 2024
kiyoon

kiyoon commented on Nov 27, 2024

@kiyoon

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

aj3sh commented on Nov 27, 2024

@aj3sh
MemberAuthor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @kiyoon@sugat009@aj3sh

    Issue actions

      Commitlint fails after squash merge · Issue #67 · opensource-nepal/commitlint