Skip to content

Commit d34af44

Browse files
committed
Recognise master branch-equivalent as master
1 parent 5e2b700 commit d34af44

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

scripts/open-user-pr.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@
44
import { Octokit } from "@octokit/rest";
55
import {runSequence} from "./run-sequence";
66

7-
function padNum(num: number) {
8-
const str = "" + num;
9-
return str.length >= 2 ? str : "0" + str;
10-
}
11-
127
const userName = process.env.GH_USERNAME;
138
const reviewers = process.env.REQUESTING_USER ? [process.env.REQUESTING_USER] : ["weswigham", "sandersn", "RyanCavanaugh"];
149
const now = new Date();
1510
const masterBranchname = `user-baseline-updates`;
16-
const branchName = process.env.TARGET_FORK.toLowerCase() === "microsoft" && (process.env.TARGET_BRANCH || "master") === "master"
11+
const targetBranch = process.env.TARGET_BRANCH || "master";
12+
const branchName = process.env.TARGET_FORK.toLowerCase() === "microsoft" && (targetBranch === "master" || targetBranch === "refs/heads/master")
1713
? masterBranchname
18-
: `user-update-${process.env.TARGET_FORK}-${now.getFullYear()}${padNum(now.getMonth() + 1)}${padNum(now.getDate())}${process.env.TARGET_BRANCH ? "-" + process.env.TARGET_BRANCH : ""}`;
14+
: `user-update-${process.env.TARGET_FORK}-${process.env.TARGET_BRANCH ? "-" + process.env.TARGET_BRANCH : ""}`;
1915
const remoteUrl = `https://${process.argv[2]}@github.com/${userName}/TypeScript.git`;
2016
const baseRef = branchName === masterBranchname ? "master" : masterBranchname;
2117
runSequence([

0 commit comments

Comments
 (0)