Skip to content

Commit 6b878e1

Browse files
committed
fix(projects): fix when only one tag generate total changelog
1 parent e227fd4 commit 6b878e1

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Changelog
22

33

4+
## [v0.0.1](https://github.com/soybeanjs/changelog/compare/2681a2f0d5feedf38f5c1b4754202dca1976948d...v0.0.1) (2023-06-07)
45

6+
###    📖 Documentation
57

8+
- **projects**: add CHANGELOG.md &nbsp;-&nbsp; by @soybeanjs [<samp>(029ea)</samp>](https://github.com/soybeanjs/changelog/commit/029eaa7)
69

7-
## [v0.0.1](https://github.com/soybeanjs/changelog/compare/...main) (23-06-07)
8-
9-
### &nbsp;&nbsp;&nbsp;📖 Documentation
10+
### &nbsp;&nbsp;&nbsp;🏡 Chore
1011

11-
- **projects**: Add CHANGELOG.md &nbsp;-&nbsp; by @soybeanjs [<samp>(029ea)</samp>](https://github.com/soybeanjs/changelog/commit/029eaa7)
12+
- **projects**: release v0.0.1 &nbsp;-&nbsp; by @soybeanjs [<samp>(e227f)</samp>](https://github.com/soybeanjs/changelog/commit/e227fd4)
1213

1314
### &nbsp;&nbsp;&nbsp;❤️ Contributors
1415

src/git.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,13 @@ export async function getGitCommitsAndResolvedAuthors(
260260
for await (const commit of commits) {
261261
const resolvedAuthors: ResolvedAuthor[] = [];
262262

263-
for await (const [index, author] of Object.entries(commit.authors)) {
263+
for await (const [index, author] of commit.authors.entries()) {
264264
const { email, name } = author;
265265

266266
if (email && name) {
267267
const commitHashes: string[] = [];
268268

269-
if (index === '0') {
269+
if (index === 0) {
270270
commitHashes.push(commit.shortHash);
271271
}
272272

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export async function getTotalChangelogMarkdown(options?: Partial<ChangelogOptio
3838

3939
const tags = getFromToTags(opts.tags);
4040

41+
if (tags.length === 0) {
42+
return getChangelogMarkdown(opts);
43+
}
44+
4145
bar?.start(tags.length, 0);
4246

4347
let markdown = '';

src/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function createDefaultOptions() {
3636
to: '',
3737
tags: [],
3838
tagDateMap: new Map(),
39-
capitalize: true,
39+
capitalize: false,
4040
emoji: true,
4141
titles: {
4242
breakingChanges: '🚨 Breaking Changes'

0 commit comments

Comments
 (0)