allow empty committer (#1714)

This commit is contained in:
laurentsimon 2022-03-07 13:25:54 -08:00 committed by GitHub
parent c1761a8936
commit e128c3de82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,6 @@ package githubrepo
import (
"context"
"errors"
"fmt"
"strings"
"sync"
@ -37,8 +36,6 @@ const (
commitsToAnalyze = 30
)
var errorInvalidCommitterLogin = errors.New("cannot retrieve committer login")
// nolint: govet
type graphqlData struct {
Repository struct {
@ -198,6 +195,7 @@ func (handler *graphqlHandler) isArchived() (bool, error) {
return handler.archived, nil
}
//nolint
func commitsFrom(data *graphqlData, repoOwner, repoName string) ([]clients.Commit, error) {
ret := make([]clients.Commit, 0)
for _, commit := range data.Repository.Object.Commit.History.Nodes {
@ -214,10 +212,6 @@ func commitsFrom(data *graphqlData, repoOwner, repoName string) ([]clients.Commi
committer = "github"
}
if committer == "" {
return ret, fmt.Errorf("commit %s: %w", commit.Oid, errorInvalidCommitterLogin)
}
var associatedPR clients.PullRequest
for i := range commit.AssociatedPullRequests.Nodes {
pr := commit.AssociatedPullRequests.Nodes[i]