Skip to content

False positive warning with the current Gitlab CI example #3083

@ddsultan

Description

@ddsultan

Expected Behavior

On Gitlab CI (Gitlab: 14.5.2 and Gitlab CI 14.4.0) when running commitlint with a valid multi-line commit body, it should not give a false warning:

echo "fix: update dependencies

  - package 1
  - package 2
" | npx commitlint

Current Behavior

The current Gitlab CI example works fine with commit messages without body, but gives a false warning message with multi-line commit body:

⧗   input: fix(deps): update dependencies\n\n
⚠   body must have leading blank line [body-leading-blank]
⚠   found 0 problems, 1 warnings

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Use CI_COMMIT_MESSAGE instead of CI_COMMIT_TITLE}\n\n${CI_COMMIT_DESCRIPTION:

The full commit message.

Steps to Reproduce (for bugs)

  1. Run the example on with a valid multi-line commit message with body
commitlint.config.js Default config ```js ```

Context

Your Environment

Executable Version
commitlint --version 16.2.1
git --version 2.27.0
node --version 16.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions