absolute-version / commit-and-tag-version

Fork of the excellent standard-version. Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org :trophy:
ISC License
425 stars 40 forks source link

Custom commitUrlFormat and issueUrlFormat not recognized and used in the CHANGELOG #171

Closed borzaka closed 3 months ago

borzaka commented 3 months ago

Describe the bug I have configured a custom commitUrlFormat and issueUrlFormat, but in the generated CHANGELOG.md none of them are recognized and used.

The config file:

{
  "types": [
    { "type": "feat", "section": "New Features" },
    { "type": "fix", "section": "Bug Fixes" },
    { "type": "chore", "section": "Maintenance Tasks" },
    { "type": "docs", "section": "Documentation" },
    { "type": "style", "section": "Code Styling" },
    { "type": "refactor", "section": "Code Refactoring" },
    { "type": "perf", "section": "Performance Improvements" },
    { "type": "test", "section": "Testing" },
    { "type": "build", "section": "Build System" },
    { "type": "ci", "section": "Continuous Integration" },
    { "type": "revert", "section": "Reversions" }
  ],
  "commitUrlFormat": "https://bitbucket.xxx.hu/projects/yyy/repos/ccc/commits/{{hash}}",
  "compareUrlFormat": "https://bitbucket.xxx.hu/projects/yyy/repos/ccc/compare/commits?sourceBranch=refs%2Ftags%2F{{currentTag}}&targetRepoId=1439&targetBranch=refs%2Ftags%2F{{previousTag}}",
  "issueUrlFormat": "https://jira.xxx.hu/browse/ZZZ-{{id}}",
  "issuePrefixes": ["ZZZ-"],
  "tagPrefix": "",
  "skip": {
    "bump": false,
    "changelog": false,
    "commit": false,
    "tag": false
  },
  "writerOpts": {
    "commitsSort": false
  }
}

Current behavior In the generated CHANGELOG.md the commit hashes and the issues are not linked.

Commands run: npm run release -- --first-release, but without the --first-release it's also the same.

Generated CHANGELOG.md

## [0.18.14](https://bitbucket.xxx.hu/projects/yyy/repos/ccc/compare/commits?sourceBranch=refs%2Ftags%2F0.18.14&targetRepoId=1439&targetBranch=refs%2Ftags%2F0.18.13) (2024-08-07)

### New Features

* make KKK as default carrierId if not selected 57d97a5, closes ZZZ-10129

### Bug Fixes

* fix order, playment and other common pages padding/margin 2323067, closes ZZZ-10162

### Maintenance Tasks

* simplify commitlint rules 4e29018

Expected behavior In the generated CHANGELOG.md the commit hashes and the issues are linked.

Environment

Possible Solution

Additional context

Refs: ZZZ-10162

borzaka commented 3 months ago

The problem is with the multiple Remotes. If I clone only the Bitbucket version to a new folder, it works fine. So, any solution for that? :)

image

borzaka commented 3 months ago

The solution was: set the repository.url in the package.json:

"repository": {
  "url": "https://bitbucket.xxx.hu/projects/yyy/repos/ccc"
},