semantic-release / release-notes-generator

:clipboard: semantic-release plugin to generate changelog content with conventional-changelog
MIT License
317 stars 47 forks source link

Configure compare URL and commit URL with Angular preset #695

Open GiamBoscaro opened 3 months ago

GiamBoscaro commented 3 months ago

I am generating the CHANGELOG for some repositories hosted in an on premise Bitbucket. The compare and commit link are generated wrong. The repositoryUrl parameter is configured as this: https://<host>/git/scm/<project>/<repo>.git. The commit url should be this: https://<host>/git/projects/<project>/repos/<repo>/commits/<commit-sha> The compare url should be this: https://<host>/git/projects/<project>/repos/<repo>/compare/diff?sourceBranch=refs%2Ftags%2F<current-tag>&targetBranch=refs%2Ftags%2F<previous-tag>

As you can see the links are different from each other and completely different from the ones generated by the preset. One of the reasons (but not the only one) is that the preset is using repositoryUrl to generate the links to the commit url and compare url, but the repositoryUrl used to git pull and git push is completely different from the one that should be for the links.

I have seen that for other presets you could use presetConfig to configure these links. An example:

"presetConfig": { 
        "commitUrlFormat": "{{host}}/git/projects/{{owner}}/repos/{{repository}}/commits/{{hash}}",
        "compareUrlFormat": "{{host}}/git/projects/{{owner}}/repos/{{repository}}/diff?sourceBranch=refs%2Ftags%2F/{{currentTag}}&targetBranch=refs%2Ftags%2F{{previousTag}}"
}

but these do not seem to work with the angular preset. So is there any way to customize these links?