Skip to content

Commit

Permalink
Properly handle writing multi-line output
Browse files Browse the repository at this point in the history
  • Loading branch information
theturtle32 committed Nov 19, 2024
1 parent 310c50f commit 8bae032
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
async function main() {
const {randomUUID} = require('crypto');
const homedir = require('os').homedir();
const tempdir = require('os').tmpdir();
const fs = require('fs');
const {execFile} = require('child_process');
const tmp = require('tmp');
const {waitFile} = require('wait-file');

const multiLineDelimiter = randomUUID();

console.log("\033[36mPWD: " + process.cwd() + "\033[0m");

tmp.setGracefulCleanup();
Expand Down Expand Up @@ -108,7 +111,10 @@ async function main() {
}
});
});
fs.appendFileSync(process.env.GITHUB_OUTPUT, 'helm_output=' + result.trim().split('%').join('%25').split('\n').join('%0A').split('\r').join('%0D') + '\n');
fs.appendFileSync(
process.env.GITHUB_OUTPUT,
`helm_output<<${multiLineDelimiter}\n${result.trim()}\n${multiLineDelimiter}\n`
);
} catch (error) {
process.exit(1);
} finally {
Expand Down

0 comments on commit 8bae032

Please sign in to comment.