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

fix: added Bitbucket correct "commit" link #1210

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ const releaseAsRegex = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]
const owner = '{{#if this.owner}}{{~this.owner}}{{else}}{{~@root.owner}}{{/if}}'
const host = '{{~@root.host}}'
const repository = '{{#if this.repository}}{{~this.repository}}{{else}}{{~@root.repository}}{{/if}}'
const commitRemoteUrl = host.includes('bitbucket.org') ? 'commits' : 'commit'

export async function createWriterOpts (config) {
const finalConfig = {
types: DEFAULT_COMMIT_TYPES,
issueUrlFormat: '{{host}}/{{owner}}/{{repository}}/issues/{{id}}',
commitUrlFormat: '{{host}}/{{owner}}/{{repository}}/commit/{{hash}}',
commitUrlFormat: '{{host}}/{{owner}}/{{repository}}/{{commitRemoteUrl}}/{{hash}}',
compareUrlFormat: '{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}',
userUrlFormat: '{{host}}/{{user}}',
issuePrefixes: ['#'],
Expand All @@ -27,7 +28,8 @@ export async function createWriterOpts (config) {
const commitUrlFormat = expandTemplate(finalConfig.commitUrlFormat, {
host,
owner,
repository
repository,
commitRemoteUrl
})
const compareUrlFormat = expandTemplate(finalConfig.compareUrlFormat, {
host,
Expand Down