Skip to content

Commit

Permalink
fix(2808): Fix to get prInfo for no fork repo PR (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
kumada626 authored Jan 13, 2023
1 parent 89494f2 commit 5c37be4
Show file tree
Hide file tree
Showing 3 changed files with 443 additions and 2 deletions.
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1667,8 +1667,15 @@ class GithubScm extends Scm {
repo: scmInfo.repo
}
});
const prSource =
pullRequestInfo.data.head.repo.id === pullRequestInfo.data.base.repo.id ? 'branch' : 'fork';
let prSource = 'fork';

if (
pullRequestInfo.data.head.repo &&
pullRequestInfo.data.base.repo &&
pullRequestInfo.data.head.repo.id === pullRequestInfo.data.base.repo.id
) {
prSource = 'branch';
}

return {
name: `PR-${pullRequestInfo.data.number}`,
Expand Down
Loading

0 comments on commit 5c37be4

Please sign in to comment.