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: add support for repository suffix and add "/-" as GitLab repo suffix #450

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

doteric
Copy link

@doteric doteric commented May 19, 2023

Addresses the #449 issue.

@travi , please let me know is this an acceptable way to handle this or you would prefer some other way. I found it not really convenient for any other approach + TypeScript would help a lot in the future 😁

Anything else would require work inside conventional-changelog-writer and also possibly in every changelog template. For example conventional-changelog-eslint has ...{{@root.repository}}/compare/{{previousTag}}...{{currentTag}}...

@@ -41,7 +41,7 @@ export async function generateNotes(pluginConfig, context) {
protocol = protocol && /http[^s]/.test(protocol) ? "http" : "https";
const [, owner, repository] = /^\/(?<owner>[^/]+)?\/?(?<repository>.+)?$/.exec(pathname);

const { issue, commit, referenceActions, issuePrefixes } =
const { issue, commit, referenceActions, issuePrefixes, repositoryPathSuffix } =
Copy link
Author

@doteric doteric May 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { issue, commit, referenceActions, issuePrefixes, repositoryPathSuffix } =
const { issue, commit, referenceActions, issuePrefixes, repositoryPathSuffix = "" } =

I could also default to an empty string if you'd like and just do

repository:`${repository}${repositoryPathSuffix}`,

Whatever is preferred ;D

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

Successfully merging this pull request may close these issues.

None yet

1 participant