Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 40 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,112 @@
# Changelog

## [3.4.0](https://github.com/uphold/github-changelog-generator/releases/tag/v3.4.0) (2023-11-03)
## [v3.4.0](https://github.com/uphold/github-changelog-generator/releases/tag/v3.4.0) (2023-11-03)

- Add support for mono-repositories [\#119](https://github.com/uphold/github-changelog-generator/pull/119) ([satazor](https://github.com/satazor))

## [3.3.1](https://github.com/uphold/github-changelog-generator/releases/tag/v3.3.1) (2022-12-20)
## [v3.3.1](https://github.com/uphold/github-changelog-generator/releases/tag/v3.3.1) (2022-12-20)

- Update dev dependencies [\#113](https://github.com/uphold/github-changelog-generator/pull/113) ([goncalvesnelson](https://github.com/goncalvesnelson))
- Bump minimist from 1.2.5 to 1.2.6 [\#104](https://github.com/uphold/github-changelog-generator/pull/104) ([dependabot](https://github.com/apps/dependabot))

## [3.3.0](https://github.com/uphold/github-changelog-generator/releases/tag/v3.3.0) (2022-07-11)
## [v3.3.0](https://github.com/uphold/github-changelog-generator/releases/tag/v3.3.0) (2022-07-11)

- Bump node-fetch from 2.6.6 to 2.6.7 [\#106](https://github.com/uphold/github-changelog-generator/pull/106) ([dependabot](https://github.com/apps/dependabot))
- Bump moment from 2.29.1 to 2.29.4 [\#110](https://github.com/uphold/github-changelog-generator/pull/110) ([dependabot](https://github.com/apps/dependabot))

## [3.2.0](https://github.com/uphold/github-changelog-generator/releases/tag/v3.2.0) (2022-06-12)
## [v3.2.0](https://github.com/uphold/github-changelog-generator/releases/tag/v3.2.0) (2022-06-12)

- Support http remotes when detecting repo and owner [\#107](https://github.com/uphold/github-changelog-generator/pull/107) ([satazor](https://github.com/satazor))

## [3.1.0](https://github.com/uphold/github-changelog-generator/releases/tag/v3.1.0) (2022-05-26)
## [v3.1.0](https://github.com/uphold/github-changelog-generator/releases/tag/v3.1.0) (2022-05-26)

- Fix generator to work on repos without releases [\#102](https://github.com/uphold/github-changelog-generator/pull/102) ([Americas](https://github.com/Americas))

## [3.0.0](https://github.com/uphold/github-changelog-generator/releases/tag/v3.0.0) (2021-11-08)
## [v3.0.0](https://github.com/uphold/github-changelog-generator/releases/tag/v3.0.0) (2021-11-08)

- Bump dependencies [\#96](https://github.com/uphold/github-changelog-generator/pull/96) ([diogotorres97](https://github.com/diogotorres97))

## [2.0.0](https://github.com/uphold/github-changelog-generator/releases/tag/v2.0.0) (2021-04-15)
## [v2.0.0](https://github.com/uphold/github-changelog-generator/releases/tag/v2.0.0) (2021-04-15)

- Simplify version grep in release script [\#89](https://github.com/uphold/github-changelog-generator/pull/89) ([Americas](https://github.com/Americas))
- Add release script [\#88](https://github.com/uphold/github-changelog-generator/pull/88) ([Americas](https://github.com/Americas))
- Bump packages [\#86](https://github.com/uphold/github-changelog-generator/pull/86) ([Americas](https://github.com/Americas))
- Improve Changelog generation performance [\#80](https://github.com/uphold/github-changelog-generator/pull/80) ([goncalvesnelson](https://github.com/goncalvesnelson))
- Release 1.0.2 [\#74](https://github.com/uphold/github-changelog-generator/pull/74) ([cristianooliveira](https://github.com/cristianooliveira))

## [1.0.2](https://github.com/uphold/github-changelog-generator/releases/tag/v1.0.2) (2019-11-13)
## [v1.0.2](https://github.com/uphold/github-changelog-generator/releases/tag/v1.0.2) (2019-11-13)

- Update octokit/rest@16.34.1 [\#73](https://github.com/uphold/github-changelog-generator/pull/73) ([cristianooliveira](https://github.com/cristianooliveira))

## [1.0.1](https://github.com/uphold/github-changelog-generator/releases/tag/v1.0.1) (2019-10-11)
## [v1.0.1](https://github.com/uphold/github-changelog-generator/releases/tag/v1.0.1) (2019-10-11)

- Fix missing files from npm [\#71](https://github.com/uphold/github-changelog-generator/pull/71) ([rplopes](https://github.com/rplopes))

## [1.0.0](https://github.com/uphold/github-changelog-generator/releases/tag/v1.0.0) (2019-10-11)
## [v1.0.0](https://github.com/uphold/github-changelog-generator/releases/tag/v1.0.0) (2019-10-11)

- Update jest@24.9.0 [\#70](https://github.com/uphold/github-changelog-generator/pull/70) ([rplopes](https://github.com/rplopes))
- Remove Babel [\#69](https://github.com/uphold/github-changelog-generator/pull/69) ([rplopes](https://github.com/rplopes))
- Update dependencies [\#68](https://github.com/uphold/github-changelog-generator/pull/68) ([rplopes](https://github.com/rplopes))
- Upgrade dependencies [\#67](https://github.com/uphold/github-changelog-generator/pull/67) ([rplopes](https://github.com/rplopes))

## [0.8.1](https://github.com/uphold/github-changelog-generator/releases/tag/v0.8.1) (2019-02-27)
## [v0.8.1](https://github.com/uphold/github-changelog-generator/releases/tag/v0.8.1) (2019-02-27)

- Update resolved dependencies [\#66](https://github.com/uphold/github-changelog-generator/pull/66) ([rplopes](https://github.com/rplopes))
- Update dependencies [\#65](https://github.com/uphold/github-changelog-generator/pull/65) ([rplopes](https://github.com/rplopes))
- Fix GitHub deprecation warnings [\#64](https://github.com/uphold/github-changelog-generator/pull/64) ([rplopes](https://github.com/rplopes))

## [0.8.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.8.0) (2018-11-28)
## [v0.8.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.8.0) (2018-11-28)

- Add option to filter PRs by labels [\#62](https://github.com/uphold/github-changelog-generator/pull/62) ([Americas](https://github.com/Americas))
- Update dev dependencies and flow [\#61](https://github.com/uphold/github-changelog-generator/pull/61) ([Americas](https://github.com/Americas))
- Use shorthanded call to generate changelog [\#59](https://github.com/uphold/github-changelog-generator/pull/59) ([Americas](https://github.com/Americas))
- Add support for node engine >= 6 [\#58](https://github.com/uphold/github-changelog-generator/pull/58) ([Americas](https://github.com/Americas))
- Update github package to octokit [\#57](https://github.com/uphold/github-changelog-generator/pull/57) ([Americas](https://github.com/Americas))
- Extract components [\#54](https://github.com/uphold/github-changelog-generator/pull/54) ([rplopes](https://github.com/rplopes))

## [0.7.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.7.0) (2018-06-07)
## [v0.7.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.7.0) (2018-06-07)

- Infer owner and repo from git config [\#50](https://github.com/uphold/github-changelog-generator/pull/50) ([rplopes](https://github.com/rplopes))

## [0.6.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.6.0) (2018-04-06)
## [v0.6.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.6.0) (2018-04-06)

- Fix excessive API calls [\#49](https://github.com/uphold/github-changelog-generator/pull/49) ([rplopes](https://github.com/rplopes))
- Fix GitHub name [\#46](https://github.com/uphold/github-changelog-generator/pull/46) ([rplopes](https://github.com/rplopes))

## [0.5.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.5.0) (2018-03-02)
## [v0.5.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.5.0) (2018-03-02)

- Generation of CHANGELOG filtering merges by base branch [\#43](https://github.com/uphold/github-changelog-generator/pull/43) ([marianacapelo](https://github.com/marianacapelo))

## [0.4.1](https://github.com/uphold/github-changelog-generator/releases/tag/v0.4.1) (2017-03-17)
## [v0.4.1](https://github.com/uphold/github-changelog-generator/releases/tag/v0.4.1) (2017-03-17)

- Fix npm pack ignoring bin folder [\#41](https://github.com/uphold/github-changelog-generator/pull/41) ([kurayama](https://github.com/kurayama))
- Add repository in package.json [\#40](https://github.com/uphold/github-changelog-generator/pull/40) ([kurayama](https://github.com/kurayama))

## [0.4.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.4.0) (2017-03-17)
## [v0.4.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.4.0) (2017-03-17)

- Use @uphold scope [\#37](https://github.com/uphold/github-changelog-generator/pull/37) ([kurayama](https://github.com/kurayama))
- Whitelist files in .npmignore [\#36](https://github.com/uphold/github-changelog-generator/pull/36) ([kurayama](https://github.com/kurayama))
- Fix empty release names [\#33](https://github.com/uphold/github-changelog-generator/pull/33) ([rplopes](https://github.com/rplopes))
- Fix typo in Usage section [\#34](https://github.com/uphold/github-changelog-generator/pull/34) ([hitmanmcc](https://github.com/hitmanmcc))

## [0.3.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.3.0) (2017-01-17)
## [v0.3.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.3.0) (2017-01-17)

- Update changelog script [\#30](https://github.com/uphold/github-changelog-generator/pull/30) ([rplopes](https://github.com/rplopes))
- Allow specifying release tag names [\#29](https://github.com/uphold/github-changelog-generator/pull/29) ([rplopes](https://github.com/rplopes))
- Add command line interface arguments [\#28](https://github.com/uphold/github-changelog-generator/pull/28) ([Americas](https://github.com/Americas))
- Simplify babel usage [\#27](https://github.com/uphold/github-changelog-generator/pull/27) ([rplopes](https://github.com/rplopes))

## [0.2.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.2.0) (2016-11-25)
## [v0.2.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.2.0) (2016-11-25)

- Transpile before running changelog [\#22](https://github.com/uphold/github-changelog-generator/pull/22) ([rplopes](https://github.com/rplopes))
- Fix executable path [\#21](https://github.com/uphold/github-changelog-generator/pull/21) ([kurayama](https://github.com/kurayama))
- Fix future release URL [\#20](https://github.com/uphold/github-changelog-generator/pull/20) ([rplopes](https://github.com/rplopes))
- Add scripts for generating changelog and version [\#9](https://github.com/uphold/github-changelog-generator/pull/9) ([rplopes](https://github.com/rplopes))
- Remove `dist/` from `.gitignore` [\#7](https://github.com/uphold/github-changelog-generator/pull/7) ([rplopes](https://github.com/rplopes))
- Fix Pull Request number display [\#6](https://github.com/uphold/github-changelog-generator/pull/6) ([rplopes](https://github.com/rplopes))

## [0.1.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.1.0) (2016-11-25)
## [v0.1.0](https://github.com/uphold/github-changelog-generator/releases/tag/v0.1.0) (2016-11-25)

- Move babel-polyfill to dependency [\#5](https://github.com/uphold/github-changelog-generator/pull/5) ([kurayama](https://github.com/kurayama))
- Fix last page [\#4](https://github.com/uphold/github-changelog-generator/pull/4) ([kurayama](https://github.com/kurayama))
- Add .npmignore [\#3](https://github.com/uphold/github-changelog-generator/pull/3) ([kurayama](https://github.com/kurayama))
Expand Down
4 changes: 3 additions & 1 deletion src/changelog-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class ChangelogFetcher {
createdAt: moment.utc(),
name: this.futureRelease,
pullRequests,
tagName: this.futureReleaseTag,
url: `https://github.com/${this.owner}/${this.repo}/releases/tag/${this.futureReleaseTag}`
}
];
Expand Down Expand Up @@ -342,10 +343,11 @@ class ChangelogFetcher {
({ cursor, hasMoreResults, releases } = await this.getReleasesQuery(cursor));

result.push(
...releases.map(({ name, tagCommit, url }) => ({
...releases.map(({ name, tagCommit, tagName, url }) => ({
createdAt: moment(tagCommit.committedDate),
name,
pullRequests: [],
tagName,
url
}))
);
Expand Down
6 changes: 3 additions & 3 deletions src/changelog-formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export const formatChangelog = releases => {
const changelog = ['# Changelog\n'];

for (const release of releases) {
changelog.push(
`\n## [${release.name || release.tagName}](${release.url}) (${release.createdAt.format('YYYY-MM-DD')})\n`
);
const releaseNumber = release.tagName || release.name;

changelog.push(`\n## [${releaseNumber}](${release.url}) (${release.createdAt.format('YYYY-MM-DD')})\n\n`);

for (const { author, number, title, url } of release.pullRequests) {
changelog.push(`- ${title} [\\#${number}](${url}) ([${author.login}](${author.url}))\n`);
Expand Down
20 changes: 17 additions & 3 deletions test/changelog-fetcher.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ describe('ChangelogFetcher', () => {
tagCommit: {
committedDate: moment('2018-10-23T12').toISOString()
},
tagName: 'foobar-name',
tagName: 'foobar-tagname',
url: 'foobar-url'
},
{
name: 'bizbaz-name',
tagCommit: {
committedDate: moment('2018-10-22T12').toISOString()
},
tagName: 'bizbaz-name',
tagName: 'bizbaz-tagname',
url: 'bizbaz-url'
}
];
Expand Down Expand Up @@ -230,6 +230,7 @@ describe('ChangelogFetcher', () => {
url: 'foobiz-url'
}
],
tagName: 'foobar-tagname',
url: 'foobar-url'
},
{
Expand All @@ -253,6 +254,7 @@ describe('ChangelogFetcher', () => {
url: 'barbuz-url'
}
],
tagName: 'bizbaz-tagname',
url: 'bizbaz-url'
}
]);
Expand Down Expand Up @@ -295,6 +297,7 @@ describe('ChangelogFetcher', () => {
url: 'foobiz-url'
}
],
tagName: 'foobar-tagname',
url: 'foobar-url'
},
{
Expand All @@ -318,6 +321,7 @@ describe('ChangelogFetcher', () => {
url: 'barbuz-url'
}
],
tagName: 'bizbaz-tagname',
url: 'bizbaz-url'
}
]);
Expand Down Expand Up @@ -377,6 +381,7 @@ describe('ChangelogFetcher', () => {
url: 'barbuz-url'
}
],
tagName: 'foobar-tagname',
url: 'foobar-url'
}
]);
Expand Down Expand Up @@ -413,6 +418,7 @@ describe('ChangelogFetcher', () => {
url: 'foobiz-url'
}
],
tagName: 'foobar-tagname',
url: 'foobar-url'
},
{
Expand All @@ -428,6 +434,7 @@ describe('ChangelogFetcher', () => {
url: 'barbiz-url'
}
],
tagName: 'bizbaz-tagname',
url: 'bizbaz-url'
}
]);
Expand Down Expand Up @@ -464,12 +471,14 @@ describe('ChangelogFetcher', () => {
url: 'foobar-url'
}
],
tagName: 'foobar-tagname',
url: 'foobar-url'
},
{
createdAt: moment(moment('2018-10-22T12').toISOString()),
name: 'bizbaz-name',
pullRequests: [],
tagName: 'bizbaz-tagname',
url: 'bizbaz-url'
}
]);
Expand Down Expand Up @@ -565,6 +574,7 @@ describe('ChangelogFetcher', () => {
url: 'foobiz-url'
}
],
tagName: 'futRel',
url: 'https://github.com/biz/buz/releases/tag/futRel'
}
]);
Expand Down Expand Up @@ -616,6 +626,7 @@ describe('ChangelogFetcher', () => {
url: 'foobiz-url'
}
],
tagName: 'futRel',
url: 'https://github.com/biz/buz/releases/tag/futRel'
}
]);
Expand Down Expand Up @@ -652,6 +663,7 @@ describe('ChangelogFetcher', () => {
url: 'quxfoo-url'
}
],
tagName: 'futRel',
url: 'https://github.com/biz/buz/releases/tag/futRel'
}
]);
Expand Down Expand Up @@ -696,6 +708,7 @@ describe('ChangelogFetcher', () => {
url: 'foobiz-url'
}
],
tagName: 'futRel',
url: 'https://github.com/biz/buz/releases/tag/futRel'
}
]);
Expand Down Expand Up @@ -732,6 +745,7 @@ describe('ChangelogFetcher', () => {
url: 'foobar-url'
}
],
tagName: 'futRel',
url: 'https://github.com/biz/buz/releases/tag/futRel'
}
]);
Expand Down Expand Up @@ -870,7 +884,7 @@ describe('ChangelogFetcher', () => {
tagCommit: {
committedDate: moment.utc(moment('2018-10-23T12').toISOString())
},
tagName: 'foobar-name',
tagName: 'foobar-tagname',
url: 'foobar-url'
});
});
Expand Down
43 changes: 40 additions & 3 deletions test/changelog-formatter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,54 @@ describe('ChangelogFormatter', () => {
],
tagName: 'bar-tag',
url: 'bar-url'
},
{
createdAt: moment('2018-10-21'),
pullRequests: [
{
author: { login: 'foobuz-user-login', url: 'foobuz-user-url' },
number: 'foobuz-number',
title: 'foobuz-title',
url: 'foobuz-url'
},
{
author: { login: 'foobaz-user-login', url: 'foobaz-user-url' },
number: 'foobaz-number',
title: 'foobaz-title',
url: 'foobaz-url'
}
],
tagName: 'biz-tag',
url: 'bar-url'
},
{
createdAt: moment('2018-10-20'),
name: 'qux-name',
pullRequests: [
{
author: { login: 'fooqux-user-login', url: 'fooqux-user-url' },
number: 'fooqux-number',
title: 'fooqux-title',
url: 'fooqux-url'
}
],
url: 'bar-url'
}
];

expect(formatChangelog(releases)).toEqual([
'# Changelog\n',
'\n## [foo-name](foo-url) (2018-10-23)\n',
'\n## [foo-tag](foo-url) (2018-10-23)\n\n',
'- foobar-title [\\#foobar-number](foobar-url) ([foobar-user-login](foobar-user-url))\n',
'- foobiz-title [\\#foobiz-number](foobiz-url) ([foobiz-user-login](foobiz-user-url))\n',
'\n## [bar-tag](bar-url) (2018-10-22)\n',
'\n## [bar-tag](bar-url) (2018-10-22)\n\n',
'- barbiz-title [\\#barbiz-number](barbiz-url) ([barbiz-user-login](barbiz-user-url))\n',
'- barbuz-title [\\#barbuz-number](barbuz-url) ([barbuz-user-login](barbuz-user-url))\n'
'- barbuz-title [\\#barbuz-number](barbuz-url) ([barbuz-user-login](barbuz-user-url))\n',
'\n## [biz-tag](bar-url) (2018-10-21)\n\n',
'- foobuz-title [\\#foobuz-number](foobuz-url) ([foobuz-user-login](foobuz-user-url))\n',
'- foobaz-title [\\#foobaz-number](foobaz-url) ([foobaz-user-login](foobaz-user-url))\n',
'\n## [qux-name](bar-url) (2018-10-20)\n\n',
'- fooqux-title [\\#fooqux-number](fooqux-url) ([fooqux-user-login](fooqux-user-url))\n'
]);
});
});
Expand Down