Small addition to user PR script to support fork/branch PRs

This commit is contained in:
Wesley Wigham 2019-04-05 16:28:25 -07:00
parent c1f2aba364
commit 0ddd847e03
No known key found for this signature in database
GPG Key ID: D59F87F60C5400C9
2 changed files with 3 additions and 3 deletions

View File

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

@ -1 +1 @@
Subproject commit 46971a8454761f1a11d8fde4d96ff8d29bc4e754
Subproject commit 40bdb4eadabc9fbed7d83e3f26817a931c0763b6