build: Add GitHub scripts for rebasing PRs (#18359)

PR Close #18359
This commit is contained in:
Miško Hevery
2017-07-26 12:37:14 -07:00
committed by Miško Hevery
parent 2e714f9f2a
commit d1764fc3dd
10 changed files with 706 additions and 2 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env node
var msg = '';
if (require.main === module) {
process.stdin.setEncoding('utf8');
process.stdin.on('readable', () => {
const chunk = process.stdin.read();
if (chunk !== null) {
msg += chunk;
}
});
process.stdin.on('end', () => {
var argv = process.argv.slice(2);
console.log(rewriteMsg(msg, argv[0]));
});
}
function rewriteMsg(msg, prNo) {
var lines = msg.split(/\n/);
lines[0] += ' (#' + prNo +')';
lines.push('PR Close #' + prNo);
return lines.join('\n');
}
exports.rewriteMsg = rewriteMsg;