mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Strip trailing whitespace in output
This commit is contained in:
@@ -109,7 +109,17 @@ function writeYaml(filePath: string, data: any): void {
|
||||
quotingType: "'", // Use single quotes where quoting is needed
|
||||
forceQuotes: false,
|
||||
});
|
||||
fs.writeFileSync(filePath, header + yamlStr, "utf8");
|
||||
fs.writeFileSync(filePath, stripTrailingWhitespace(header + yamlStr), "utf8");
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip trailing whitespace from each line.
|
||||
*/
|
||||
function stripTrailingWhitespace(content: string): string {
|
||||
return content
|
||||
.split("\n")
|
||||
.map((line) => line.trimEnd())
|
||||
.join("\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user