[BUG] Use correct head commit for CODEOWNER

Backport of #2658

Regression of #2507, which switched the HEAD from `pr.GetGitRefName()`
to `pr.HeadCommitID` but it had to be `prInfo.HeadCommitID`. Resolves #2656
I was able to reproduce this locally with _some_ pull requests, haven't
been able to get a reproducer trough integration testing.

(cherry picked from commit a4cc37b46a)
This commit is contained in:
Gusted 2024-03-14 16:15:56 +01:00
parent bd71bdda26
commit d1cebb0e88
No known key found for this signature in database
GPG key ID: FD821B732837125F

View file

@ -932,7 +932,7 @@ func PullRequestCodeOwnersReview(ctx context.Context, pull *Issue, pr *PullReque
} }
// Use the merge base as the base instead of the main branch to avoid problems // Use the merge base as the base instead of the main branch to avoid problems
// if the pull request is out of date with the base branch. // if the pull request is out of date with the base branch.
changedFiles, err := repo.GetFilesChangedBetween(prInfo.MergeBase, pr.HeadCommitID) changedFiles, err := repo.GetFilesChangedBetween(prInfo.MergeBase, prInfo.HeadCommitID)
if err != nil { if err != nil {
return err return err
} }