feat: add IsForkPullRequest

This commit is contained in:
Jason Song
2022-11-23 15:12:26 +08:00
parent 6ad8bddabf
commit fdd3c0434e
6 changed files with 186 additions and 172 deletions

View File

@ -418,6 +418,11 @@ func (pr *PullRequest) IsAncestor() bool {
return pr.Status == PullRequestStatusAncestor
}
// IsFromFork return true if this PR is from a fork.
func (pr *PullRequest) IsFromFork() bool {
return pr.HeadRepoID != pr.BaseRepoID
}
// SetMerged sets a pull request to merged and closes the corresponding issue
func (pr *PullRequest) SetMerged(ctx context.Context) (bool, error) {
if pr.HasMerged {