[BUG] Disable CODEOWNERS for forked repositories

- Disable the CODEOWNERS feature for forked repositories, as it would
otherwise inadvertently request reviewers when for example a pull
request is opened against a forked repository to propose changes to an
existant pull request in the original repository.
- Adds integration test.
- Resolves #2525
This commit is contained in:
Gusted 2024-03-01 23:19:18 +01:00
parent 9ce3068f36
commit 2658d4361e
No known key found for this signature in database
GPG key ID: FD821B732837125F
2 changed files with 32 additions and 3 deletions

View file

@ -891,6 +891,14 @@ func PullRequestCodeOwnersReview(ctx context.Context, pull *Issue, pr *PullReque
return nil
}
if err := pull.LoadRepo(ctx); err != nil {
return err
}
if pull.Repo.IsFork {
return nil
}
if err := pr.LoadBaseRepo(ctx); err != nil {
return err
}