Skip to content

Commit 0ddd847

Browse files
committed
Small addition to user PR script to support fork/branch PRs
1 parent c1f2aba commit 0ddd847

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/open-user-pr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function padNum(number: number) {
2020
const userName = process.env.GH_USERNAME;
2121
const reviewers = ["weswigham", "sandersn", "RyanCavanaugh"]
2222
const now = new Date();
23-
const branchName = `user-update-${now.getFullYear()}${padNum(now.getMonth())}${padNum(now.getDay())}`;
23+
const branchName = `user-update-${process.env.TARGET_FORK}-${now.getFullYear()}${padNum(now.getMonth())}${padNum(now.getDay())}${process.env.TARGET_BRANCH ? "-" + process.env.TARGET_BRANCH : ""}`;
2424
const remoteUrl = `https://${process.argv[2]}@github.com/${userName}/TypeScript.git`;
2525
runSequence([
2626
["git", ["checkout", "."]], // reset any changes
@@ -43,7 +43,7 @@ gh.pulls.create({
4343
maintainer_can_modify: true,
4444
title: `🤖 User test baselines have changed`,
4545
head: `${userName}:${branchName}`,
46-
base: "master",
46+
base: process.env.TARGET_BRANCH || "master",
4747
body:
4848
`Please review the diff and merge if no changes are unexpected.
4949
You can view the build log [here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary).

0 commit comments

Comments
 (0)