mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
Trim whitespace, fetch origin master
This commit is contained in:
@@ -24,14 +24,17 @@ async function main() {
|
||||
]);
|
||||
const currentAuthor = runSequence([
|
||||
["git", ["log", "-1", `--pretty="%aN <%aE>"`]]
|
||||
])
|
||||
]);
|
||||
runSequence([
|
||||
["git", ["fetch", "origin", "master"]]
|
||||
]);
|
||||
let logText = runSequence([
|
||||
["git", ["log", `master..${currentSha}`, `--pretty="%h %s%n%b"`]]
|
||||
["git", ["log", `origin/master..${currentSha.trim()}`, `--pretty="%h %s%n%b"`]]
|
||||
]);
|
||||
logText = `Cherry-pick PR #${process.env.SOURCE_ISSUE} into ${process.env.TARGET_BRANCH}
|
||||
|
||||
Component commits:
|
||||
${logText}`
|
||||
${logText.trim()}`
|
||||
const logpath = path.join(__dirname, "../", "logmessage.txt");
|
||||
runSequence([
|
||||
["git", ["checkout", "-b", "temp-branch"]],
|
||||
@@ -39,7 +42,7 @@ ${logText}`
|
||||
]);
|
||||
fs.writeFileSync(logpath, logText);
|
||||
runSequence([
|
||||
["git", ["commit", "-F", logpath, `--author="${currentAuthor}"`]]
|
||||
["git", ["commit", "-F", logpath, `--author="${currentAuthor.trim()}"`]]
|
||||
]);
|
||||
fs.unlinkSync(logpath);
|
||||
const squashSha = runSequence([
|
||||
@@ -48,7 +51,7 @@ ${logText}`
|
||||
runSequence([
|
||||
["git", ["checkout", process.env.TARGET_BRANCH]], // checkout the target branch
|
||||
["git", ["checkout", "-b", branchName]], // create a new branch
|
||||
["git", ["cherry-pick", squashSha]], //
|
||||
["git", ["cherry-pick", squashSha.trim()]], //
|
||||
["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork
|
||||
["git", ["push", "--set-upstream", "fork", branchName, "-f"]] // push the branch
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user