Skip to content

Commit fa3b5dd

Browse files
committed
feat: add support for title option
1 parent a0f6c89 commit fa3b5dd

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ With this example:
6565
| `commit` | Keyword used to generate commit links (formatted as `<host>/<owner>/<repository>/<commit>/<commit_sha>`). See [conventional-changelog-writer#commit](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#commit). | `commits` for Bitbucket repositories, `commit` otherwise |
6666
| `issue` | Keyword used to generate issue links (formatted as `<host>/<owner>/<repository>/<issue>/<issue_number>`). See [conventional-changelog-writer#issue](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#issue). | `issue` for Bitbucket repositories, `issues` otherwise |
6767
| `presetConfig` | Additional configuration passed to the [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset. Used for example with [conventional-changelog-conventionalcommits](https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.0.0/README.md). | - |
68+
| `title` | The title of the release. Used for example in the [header template of conventinal-changelog-angular](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/templates/header.hbs) | - |
6869

6970
**Notes**: in order to use a `preset` it must be installed (for example to use the [eslint preset](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint) you must install it with `npm install conventional-changelog-eslint -D`)
7071

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ async function generateNotes(pluginConfig, context) {
7070
linkCompare: currentTag && previousTag,
7171
issue,
7272
commit,
73+
title: pluginConfig.title,
7374
packageData: ((await readPkgUp({normalize: false, cwd})) || {}).packageJson,
7475
},
7576
{host: hostConfig, linkCompare, linkReferences, commit: commitConfig, issue: issueConfig}

test/integration.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,16 @@ test('Accept an "issue" option', async t => {
554554
);
555555
});
556556

557+
test('Accept an "title" option', async t => {
558+
const commits = [{hash: '111', message: 'fix(scope1): First fix\n\nresolve #10'}];
559+
const changelog = await generateNotes(
560+
{issue: 'test-issues'},
561+
{cwd, options: {title: 'release-title'}, lastRelease, nextRelease, commits}
562+
);
563+
564+
t.regex(changelog, new RegExp(escape('"release-title"')));
565+
});
566+
557567
test('Ignore malformatted commits and include valid ones', async t => {
558568
const commits = [
559569
{hash: '111', message: 'fix(scope1): First fix'},

0 commit comments

Comments
 (0)