Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context attribute "compareUrl" is not working with bitbucket repository #90

Open
arkadioz opened this issue Jan 9, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@arkadioz
Copy link

arkadioz commented Jan 9, 2024

@momocow I was using the tool with github, but now I am trying to setup everything on bitbucket too, I notice that this on my default handlebars template (which is the same from the example but with the emojis):

{{#if compareUrl}}
# 🎉 [v{{nextRelease.version}}]({{compareUrl}}) ({{datetime "UTC:yyyy-mm-dd"}}) 🔖
{{else}}
# 🎉 v{{nextRelease.version}} ({{datetime "UTC:yyyy-mm-dd"}}) 🔖
{{/if}}

works with github repository, but with bitbucket it is always entering the else, is there anyway to make it work with bitbucket too?

When I was using release-notes generator plugin I also had to do some tweaks for it to work with bitbucket like so:

[
      "@semantic-release/release-notes-generator",
      {
        "preset": "conventionalcommits",
        "presetConfig": {
          "commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commits/{{hash}}",
          "compareUrlFormat": "{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}..{{currentTag}}",
          "types": [
            {
              "type": "feat",
              "section": "New Feature(s) 🚀"
            },
            {
              "type": "fix",
              "section": "Bug Fix(es) 🐛️"
            }
          ]
        }
      }
    ]

Please let me know if I can do something like this to get the compare url working, the commit url was easy to fix on the commit template but the compare url not sure how to fix.

EDIT: I was reading again this https://github.com/momocow/semantic-release-gitmoji?tab=readme-ov-file#releasenotesoptions

you mention that github is currently the only repo supported but you also mention that it is possible to override the baseUrl and other values, can you please show example how to override them? Maybe this way it can work with bitbucket too

@momocow momocow added the enhancement New feature or request label Jan 9, 2024
@momocow
Copy link
Owner

momocow commented Jan 9, 2024

After looking into source codes, I should admit that it is not easy to customize this in the current version without monkey patches.

I have marked this one as an enhancement. A more extendable pattern should be adopted to design this cross-platform VCS (Version Control System) feature.

@arkadioz
Copy link
Author

arkadioz commented Jan 9, 2024

@momocow Thanks, it would be amazing to have such a enhancement, meanwhile this is what I did on the default-handlebar template:

Replaced the if/else statement with this one:

# 🎉 [v{{nextRelease.version}}](https://{{source}}/{{owner}}/{{repo}}/compare/v{{lastRelease.version}}..v{{nextRelease.version}}) ({{datetime "UTC:yyyy-mm-dd"}}) 🔖

works so far but yeah I would prefer a lot more the enhancement, thanks again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants