Skip to content

Commit

Permalink
removing log since its no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
chiragsalian committed Dec 15, 2022
1 parent 02065d0 commit 1c9b81b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,13 @@ function getMergeLogsAsJSON(fromRef, toRef) {
})
.then((stdout) => {
// Remove any double-quotes from commit subjects
console.log(`[debug] stdOut: ${stdout}`);
let sanitizedOutput = stdout.replace(/(?<="subject": ").*(?="})/g, subject => subject.replace(/"/g, "'"));
console.log(`[debug] sanitizedOutput 1: ${sanitizedOutput}`);

// Also remove any newlines and escape backslashes
sanitizedOutput = sanitizedOutput.replace(/(\r\n|\n|\r)/gm, '').replace(/\\/g, '\\\\');
console.log(`[debug] sanitizedOutput 2: ${sanitizedOutput}`);

// Then format as JSON and convert to a proper JS object
const json = `[${sanitizedOutput}]`.replace('},]', '}]');
console.log(`[debug] json: ${json}`);

return JSON.parse(json);
});
Expand Down
4 changes: 0 additions & 4 deletions .github/actions/javascript/getDeployPullRequestList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,13 @@ function getMergeLogsAsJSON(fromRef, toRef) {
})
.then((stdout) => {
// Remove any double-quotes from commit subjects
console.log(`[debug] stdOut: ${stdout}`);
let sanitizedOutput = stdout.replace(/(?<="subject": ").*(?="})/g, subject => subject.replace(/"/g, "'"));
console.log(`[debug] sanitizedOutput 1: ${sanitizedOutput}`);

// Also remove any newlines and escape backslashes
sanitizedOutput = sanitizedOutput.replace(/(\r\n|\n|\r)/gm, '').replace(/\\/g, '\\\\');
console.log(`[debug] sanitizedOutput 2: ${sanitizedOutput}`);

// Then format as JSON and convert to a proper JS object
const json = `[${sanitizedOutput}]`.replace('},]', '}]');
console.log(`[debug] json: ${json}`);

return JSON.parse(json);
});
Expand Down
4 changes: 0 additions & 4 deletions .github/libs/GitUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,13 @@ function getMergeLogsAsJSON(fromRef, toRef) {
})
.then((stdout) => {
// Remove any double-quotes from commit subjects
console.log(`[debug] stdOut: ${stdout}`);
let sanitizedOutput = stdout.replace(/(?<="subject": ").*(?="})/g, subject => subject.replace(/"/g, "'"));
console.log(`[debug] sanitizedOutput 1: ${sanitizedOutput}`);

// Also remove any newlines and escape backslashes
sanitizedOutput = sanitizedOutput.replace(/(\r\n|\n|\r)/gm, '').replace(/\\/g, '\\\\');
console.log(`[debug] sanitizedOutput 2: ${sanitizedOutput}`);

// Then format as JSON and convert to a proper JS object
const json = `[${sanitizedOutput}]`.replace('},]', '}]');
console.log(`[debug] json: ${json}`);

return JSON.parse(json);
});
Expand Down

0 comments on commit 1c9b81b

Please sign in to comment.