Skip to content

Commit

Permalink
Merge pull request #3 from intuit/bug2
Browse files Browse the repository at this point in the history
ignore invalid user
  • Loading branch information
hipstersmoothie authored Dec 5, 2018
2 parents 0b9f79d + f6c15b8 commit 8b44cdd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/log-parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export const createUserLink = (
) => {
const githubUrl = new URL(options.baseUrl).origin;

if (author.username === 'invalid-email-address') {
return;
}

return author.username
? `[@${author.username}](${join(githubUrl, author.username)})`
: author.email || commit.author.email;
Expand Down Expand Up @@ -184,10 +188,9 @@ function generateCommitNote(
pr = `[#${commit.pullRequest.number}](${prLink})`;
}

return `- ${jira}${commit.comment} ${pr} (${createUserLinkList(
commit,
options
)})`;
const user = createUserLinkList(commit, options);

return `- ${jira}${commit.comment} ${pr}${user ? ` (${user})` : ''}`;
}

const filterLabel = (commits: IExtendedCommit[], label: string) =>
Expand Down Expand Up @@ -312,6 +315,10 @@ function createAuthorSection(
)
.reduce((commitAuthors: string[], commit) => {
commit.authors.map(author => {
if (author.username === 'invalid-email-address') {
return commitAuthors;
}

const user = createUserLink(author, commit, options);
const authorString = `- ${author.name} (${user})`;

Expand Down

0 comments on commit 8b44cdd

Please sign in to comment.