semver icon indicating copy to clipboard operation
semver copied to clipboard

Custom headerPattern doesn't get picked up by changelog conventional-commit-parser

Open NullDivision opened this issue 1 year ago • 1 comments

When using a custom header such as the one below setting a custom headerPattern value gets picked up correctly to determine what the new version should be but the changelog itself is not including the commit message.

"version": {
      "executor": "@jscutlery/semver:version",
      "options": {
        "preset": "conventional",
        "baseBranch": "main",
        "commitMessageFormat": "chore(${projectName}): release version ${version} [skip ci]",
        "commitParserOptions": {
          "headerPattern": "^(\\w*)\\(comp-(\\w*)\\)?\\: (.*)$"
        }
      }
    }

It looks like conventionalChangelog isn't taking into account the headerPattern when determining what to include in the changelog. https://github.com/jscutlery/semver/blob/aa966b0353a94bb38e1c1c817a0b35711ee5ca4c/packages/semver/src/executors/version/utils/init-conventional-commit-readable-stream.ts#L9

NullDivision avatar Sep 15 '23 12:09 NullDivision

Noticed the same.

nikbabchenko avatar Sep 19 '23 20:09 nikbabchenko