prow/plugins/dco/dco.go
func checkCommitMessages(gc gitHubClient, l *logrus.Entry, org, repo string, number int) ([]github.GitCommit, error) {
	allCommits, err := gc.ListPRCommits(org, repo, number)
	if err != nil {
		return nil, fmt.Errorf("error listing commits for pull request: %v", err)
	}
	l.Debugf("Found %d commits in PR", len(allCommits))

	var commitsMissingDCO []github.GitCommit
	for _, commit := range allCommits {
		if !testRe.MatchString(commit.Commit.Message) {
			c := commit.Commit
			c.SHA = commit.SHA
			commitsMissingDCO = append(commitsMissingDCO, c)
		}
	}

	l.Debugf("All commits in PR have DCO signoff: %t", len(commitsMissingDCO) == 0)
	return commitsMissingDCO, nil
}
func checkCommitMessages(gc gitHubClient, l *logrus.Entry, org, repo string, number int) ([]github.GitCommit, error) {
	allCommits, err := gc.ListPRCommits(org, repo, number)
	if err != nil {
		return nil, fmt.Errorf("error listing commits for pull request: %v", err)
	}
	l.Debugf("Found %d commits in PR", len(allCommits))

	var commitsMissingDCO []github.GitCommit
	for _, commit := range allCommits {
		if !testRe.MatchString(commit.Commit.Message) {
			c := commit.Commit
			c.SHA = commit.SHA
			commitsMissingDCO = append(commitsMissingDCO, c)
		}
	}

	l.Debugf("All commits in PR have DCO signoff: %t", len(commitsMissingDCO) == 0)
	return commitsMissingDCO, nil
}
func checkCommitMessages ( gc gitHubClient , l * logrus . Entry , org , repo string , number int ) ( [ ] github . GitCommit , error ) { allCommits , err := gc . ListPRCommits ( org , repo , number ) if err != nil { return nil , fmt . Errorf ( " " , err ) } l . Debugf ( " " , len ( allCommits ) ) var commitsMissingDCO [ ] github . GitCommit for _ , commit := range allCommits { if ! testRe . MatchString ( commit . Commit . Message ) { c := commit . Commit c . SHA = commit . SHA commitsMissingDCO = append ( commitsMissingDCO , c ) } } l . Debugf ( " " , len ( commitsMissingDCO ) == 0 ) return commitsMissingDCO , nil }
// checkCommitMessages will perform the actual DCO check by retrieving all
// commits contained within the PR with the given number.
// *All* commits in the pull request *must* match the 'testRe' in order to pass.
checkCommitMessages will perform the actual DCO check by retrieving all commits contained within the PR with the given number . * All * commits in the pull request * must * match the testRe in order to pass .