summaryrefslogtreecommitdiff
path: root/source/features/add-co-authored-by.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'source/features/add-co-authored-by.tsx')
-rw-r--r--source/features/add-co-authored-by.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/features/add-co-authored-by.tsx b/source/features/add-co-authored-by.tsx
index fbc7f90e..3c011ec8 100644
--- a/source/features/add-co-authored-by.tsx
+++ b/source/features/add-co-authored-by.tsx
@@ -6,6 +6,7 @@ import {getOwnerAndRepo, getDiscussionNumber, getOP} from '../libs/utils';
interface Author {
email: string;
+ name: string; // Used when the commit isn't linked to a GitHub user
user: {
name: string;
login: string;
@@ -27,6 +28,7 @@ async function fetchCoAuthoredData(): Promise<Author[]> {
commit {
author {
email
+ name
user {
login
name
@@ -51,8 +53,12 @@ function addCoAuthors(): void {
}
const addendum = new Map();
- for (const {email, user} of coAuthors) {
- addendum.set(user.login, `Co-authored-by: ${user.name} <${email}>`);
+ for (const {email, user, name} of coAuthors) {
+ if (user) {
+ addendum.set(user.login, `Co-authored-by: ${user.name} <${email}>`);
+ } else {
+ addendum.set(name, `Co-authored-by: ${name} <${email}>`);
+ }
}
addendum.delete(getOP());