feat: add IsForkPullRequest

This commit is contained in:
Jason Song committed 2022-11-25 17:48:48 +08:00
1 parent 6ad8bddabf
commit fdd3c0434e
6 files changed
+186 -172

No files matched your search

+5
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 {