jscutlery / semver

Nx plugin to automate semantic versioning and CHANGELOG generation.
MIT License
727 stars 84 forks source link

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

Open NullDivision opened 1 year ago

NullDivision commented 1 year ago

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

nikbabchenko commented 1 year ago

Noticed the same.