Skip to content

Commit 4f3f644

Browse files
committed
fix: avoid rendering authors with [bot] in their name
Hides `Renovate[bot]`
1 parent 4871721 commit 4f3f644

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/markdown.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ export async function generateMarkDown (commits: GitCommit[], config: ChangelogC
4545

4646
const _authors = new Map<string, { email: Set<string>, github?: string }>()
4747
for (const commit of commits) {
48-
if (commit.author) {
49-
if (!_authors.has(commit.author.name)) {
50-
_authors.set(commit.author.name, { email: new Set([commit.author.email]) })
51-
} else {
52-
const entry = _authors.get(commit.author.name)
53-
entry.email.add(commit.author.email)
54-
}
48+
if (!commit.author || commit.author.name.includes('[bot]')) {
49+
continue
50+
}
51+
if (!_authors.has(commit.author.name)) {
52+
_authors.set(commit.author.name, { email: new Set([commit.author.email]) })
53+
} else {
54+
const entry = _authors.get(commit.author.name)
55+
entry.email.add(commit.author.email)
5556
}
5657
}
5758

test/git.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,7 @@ describe('git', () => {
303303
304304
### ❤️ Contributors
305305
306-
- Pooya Parsa ([@pi0](http://github.com/pi0))
307-
- Renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>"
306+
- Pooya Parsa ([@pi0](http://github.com/pi0))"
308307
`)
309308
})
310309
})

0 commit comments

Comments
 (0)