Format scripts with Prettier (#8393)
This PR does a one-off format of some of our scripts using Prettier. Release Notes: - N/A
This commit is contained in:
parent
934af6ad45
commit
368fec2822
2 changed files with 81 additions and 83 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
const { execFileSync } = require("child_process");
|
||||
const { GITHUB_ACCESS_TOKEN } = process.env;
|
||||
const PR_REGEX = /#\d+/ // Ex: matches on #4241
|
||||
const PR_REGEX = /#\d+/; // Ex: matches on #4241
|
||||
const FIXES_REGEX = /(fixes|closes|completes) (.+[/#]\d+.*)$/im;
|
||||
|
||||
main();
|
||||
|
@ -10,7 +10,7 @@ main();
|
|||
async function main() {
|
||||
// Use form of: YYYY-MM-DD - 2023-01-09
|
||||
const startDate = new Date(process.argv[2]);
|
||||
const today = new Date()
|
||||
const today = new Date();
|
||||
|
||||
console.log(`Changes from ${startDate} to ${today}\n`);
|
||||
|
||||
|
@ -32,32 +32,26 @@ async function main() {
|
|||
console.log("*", pullRequest.title);
|
||||
console.log(" PR URL: ", webURL);
|
||||
console.log(" Merged: ", pullRequest.merged_at);
|
||||
console.log()
|
||||
console.log();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getPullRequestNumbers(startDate, endDate) {
|
||||
const sinceDate = startDate.toISOString();
|
||||
const untilDate = endDate.toISOString();
|
||||
|
||||
const pullRequestNumbers = execFileSync(
|
||||
"git",
|
||||
[
|
||||
"log",
|
||||
`--since=${sinceDate}`,
|
||||
`--until=${untilDate}`,
|
||||
"--oneline"
|
||||
],
|
||||
{ encoding: "utf8" }
|
||||
["log", `--since=${sinceDate}`, `--until=${untilDate}`, "--oneline"],
|
||||
{ encoding: "utf8" },
|
||||
)
|
||||
.split("\n")
|
||||
.filter(line => line.length > 0)
|
||||
.map(line => {
|
||||
.filter((line) => line.length > 0)
|
||||
.map((line) => {
|
||||
const match = line.match(/#(\d+)/);
|
||||
return match ? match[1] : null;
|
||||
})
|
||||
.filter(line => line);
|
||||
.filter((line) => line);
|
||||
|
||||
return pullRequestNumbers;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue