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

[Question] How can I override releaseNotes? #1339

Closed
BeyondEvil opened this issue Oct 28, 2019 · 2 comments
Closed

[Question] How can I override releaseNotes? #1339

BeyondEvil opened this issue Oct 28, 2019 · 2 comments

Comments

@BeyondEvil
Copy link

BeyondEvil commented Oct 28, 2019

According to docs (or tests at least) if you use the generateNotes plugin endpoint, the results get concatenated.

Is it possible to override or otherwise change that behaviour?

We have jira ticket references in our commit messages (ENG-1234) and I want to replace them with a link to the actual ticket [ENG-1234](<url to ticket>).

How can I accomplish that?

Thanks!

Edit: If it's not possible, would you accept a PR to make it possible?

Edit2: Can I use the exec plugin to solve this?

@pvdlg
Copy link
Member

pvdlg commented Oct 28, 2019

You need to implement your own conventional-changelog preset and configure it with the preset option.
Probably by forking https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular and adding your transformation.

@pvdlg pvdlg closed this as completed Oct 28, 2019
@pvdlg pvdlg added the support label Oct 28, 2019
@BeyondEvil
Copy link
Author

Ackchyually...

            {
                "linkCompare": false,
                "writerOpts": {
                    "headerPartial": "{{#if isPatch}}##{{else}}#{{/if}} {{#if @root.linkCompare}}[{{currentTag}}]({{@root.host}}/{{#if @root.owner}}{{@root.owner}}/{{/if}}{{@root.repository}}/compare/{{previousTag}}...{{currentTag}}){{else}}{{currentTag}}{{/if}}{{#if title}} \"{{title}}\"{{/if}}{{#if date}} ({{date}}){{/if}}",
                    "transform": (commit) => {
                        if (!commit.tag || typeof commit.tag !== `string`) { 
                            return 
                        }
                        console.log(commit)
                        commit.message = commit.message.replace(/ENG-\d+/g, '[$&](https://proxyco.atlassian.net/browse/$&)');
                        commit.shortHash = commit.hash.substring(0, 7); 
                        return commit
                    }
                }
            }

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

No branches or pull requests

2 participants