Skip to content

Commit

Permalink
remove empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
yanamura committed May 10, 2023
1 parent ba3ea77 commit 6749eb0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async function run(): Promise<void> {
})

core.info(output)

output = removeStarLines(output)
output = output.replace(/%/g, '%25')
output = output.replace(/\n/g, '%0A')
output = output.replace(/\r/g, '%0D')
Expand All @@ -71,4 +71,10 @@ async function run(): Promise<void> {
})
}

function removeStarLines(inputString: string, lineBreak: string = '\n'): string {
const lines = inputString.split(lineBreak)
const filteredLines = lines.filter(line => line.trim() !== '*')
return filteredLines.join(lineBreak)
}

run()

0 comments on commit 6749eb0

Please sign in to comment.