Skip to content

Commit

Permalink
fix(core): extract github usernames when author contains ID
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Oct 20, 2023
1 parent e6c5912 commit 10d22f0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/nx/changelog-renderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,15 @@ const defaultChangelogRenderer: ChangelogRenderer = async ({
const meta = _authors.get(authorName);
for (const email of meta.email) {
// For these pseudo-anonymized emails we can just extract the Github username from before the @
// It could either be in the format: username@ or github_id+username@
if (email.endsWith('@users.noreply.github.com')) {
meta.github = email.split('@')[0];
break;
const match = email.match(
/^(\d+\+)?([^@]+)@users\.noreply\.github\.com$/
);
if (match && match[2]) {
meta.github = match[2];
break;
}
}
// Look up any other emails against the ungh.cc API
const { data } = await axios
Expand Down

0 comments on commit 10d22f0

Please sign in to comment.