(pr: GitHubPullRequest)
| 1055 | } |
| 1056 | |
| 1057 | async function checkoutForkBranch(pr: GitHubPullRequest) { |
| 1058 | console.log("Checking out fork branch...") |
| 1059 | |
| 1060 | const remoteBranch = pr.headRefName |
| 1061 | const localBranch = generateBranchName("pr") |
| 1062 | const depth = Math.max(pr.commits.totalCount, 20) |
| 1063 | |
| 1064 | await gitRun(["remote", "add", "fork", `https://github.com/${pr.headRepository.nameWithOwner}.git`]) |
| 1065 | await gitRun(["fetch", "fork", `--depth=${depth}`, remoteBranch]) |
| 1066 | await gitRun(["checkout", "-b", localBranch, `fork/${remoteBranch}`]) |
| 1067 | return localBranch |
| 1068 | } |
| 1069 | |
| 1070 | function generateBranchName(type: "issue" | "pr" | "schedule" | "dispatch") { |
| 1071 | const timestamp = new Date() |
no test coverage detected