(pr: GitHubPullRequest)
| 699 | } |
| 700 | |
| 701 | async function checkoutForkBranch(pr: GitHubPullRequest) { |
| 702 | console.log("Checking out fork branch...") |
| 703 | |
| 704 | const remoteBranch = pr.headRefName |
| 705 | const localBranch = generateBranchName("pr") |
| 706 | const depth = Math.max(pr.commits.totalCount, 20) |
| 707 | |
| 708 | await $`git remote add fork https://github.com/${pr.headRepository.nameWithOwner}.git` |
| 709 | await $`git fetch fork --depth=${depth} ${remoteBranch}` |
| 710 | await $`git checkout -b ${localBranch} fork/${remoteBranch}` |
| 711 | } |
| 712 | |
| 713 | function generateBranchName(type: "issue" | "pr") { |
| 714 | const timestamp = new Date() |
no test coverage detected