Skip to content

Commit

Permalink
warn about github commits with broken PR references
Browse files Browse the repository at this point in the history
  • Loading branch information
xrstf committed Apr 6, 2023
1 parent 6ec6b7f commit 38c92f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/github/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ func (c *Client) fetchLogPage(ctx context.Context, owner string, name string, he

commits := []types.Commit{}
for _, commit := range q.Repository.Object.Commit.History.Nodes {
if len(commit.AssociatedPullRequests.Nodes) == 0 {
c.log.WithField("commit", commit.OID).Warn("Commit has no associated pull request.")
continue
}

commits = append(commits, convertCommit(commit))
}

Expand Down

0 comments on commit 38c92f3

Please sign in to comment.