Skip to content

Commit

Permalink
Ensure error checks happen before adding results. (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
nishkrishnan authored Nov 19, 2021
1 parent 8511c35 commit 9fd8043
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/events/vcs/github_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,13 @@ func (g *GithubClient) getRepoChecks(repo models.Repo, sha string) ([]*github.Ch
}

result, response, err := g.client.Checks.ListCheckRunsForRef(g.ctx, repo.Owner, repo.Name, sha, opts)
results = append(results, result.CheckRuns...)

if err != nil {
return results, errors.Wrapf(err, "getting check runs for page %d", nextPage)
}

results = append(results, result.CheckRuns...)

if response.NextPage == 0 {
break
}
Expand Down

0 comments on commit 9fd8043

Please sign in to comment.