Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
handle empty login (#59)
Browse files Browse the repository at this point in the history
Signed-off-by: Ayman <[email protected]>

Signed-off-by: Ayman <[email protected]>
Co-authored-by: Ayman <[email protected]>
  • Loading branch information
khalifapro and enkhalifapro authored Nov 4, 2022
1 parent 4bc6643 commit 3c36311
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -9153,12 +9153,12 @@ func (j *DSGitHub) getClosedBy(ctx *shared.Ctx, id int, org string) (*insights.C
name, _ := u["name"].(string)
email, _ := u["email"].(string)
source := GitHubDataSource
userID, err := user.GenerateIdentity(&source, &email, &name, iss.ClosedBy.Login)
userID, err := user.GenerateIdentity(&source, &email, &name, &closerLogin)
if err != nil {
j.log.WithFields(logrus.Fields{"operation": "getClosedBy"}).Errorf("GenerateIdentity(%s,%s,%s,%s): %+v", source, email, name, *iss.ClosedBy.Login, err)
return nil, err
}
isBotIdentity := shared.IsBotIdentity(name, *iss.ClosedBy.Login, email, GitHubDataSource, os.Getenv("BOT_NAME_REGEX"), os.Getenv("BOT_USERNAME_REGEX"), os.Getenv("BOT_EMAIL_REGEX"))
isBotIdentity := shared.IsBotIdentity(name, closerLogin, email, GitHubDataSource, os.Getenv("BOT_NAME_REGEX"), os.Getenv("BOT_USERNAME_REGEX"), os.Getenv("BOT_EMAIL_REGEX"))
closedBY := insights.Contributor{
Role: insights.CloseAuthorRole,
Weight: 1.0,
Expand All @@ -9168,7 +9168,7 @@ func (j *DSGitHub) getClosedBy(ctx *shared.Ctx, id int, org string) (*insights.C
Email: email,
IsVerified: false,
Name: name,
Username: *iss.ClosedBy.Login,
Username: closerLogin,
Source: source,
IsBot: isBotIdentity,
},
Expand Down

0 comments on commit 3c36311

Please sign in to comment.