Skip to content

Commit

Permalink
feat: filter out bot authors
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Aug 24, 2024
1 parent 6a2b968 commit b6c2f0e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ function getHeaders(options: ChangelogOptions) {
}
}

const excludeAuthors = [
/\[bot\]/i,
/dependabot/i,
/\(bot\)/i,
]

export async function resolveAuthorInfo(options: ChangelogOptions, info: AuthorInfo) {
if (info.login)
return info
Expand Down Expand Up @@ -88,6 +94,8 @@ export async function resolveAuthors(commits: Commit[], options: ChangelogOption
commit.resolvedAuthors = commit.authors.map((a, idx) => {
if (!a.email || !a.name)
return null
if (excludeAuthors.some(re => re.test(a.name)))
return null
if (!map.has(a.email)) {
map.set(a.email, {
commits: [],
Expand Down

0 comments on commit b6c2f0e

Please sign in to comment.