Skip to content

Commit 8bae032

Browse files
committed
Properly handle writing multi-line output
1 parent 310c50f commit 8bae032

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
async function main() {
2+
const {randomUUID} = require('crypto');
23
const homedir = require('os').homedir();
34
const tempdir = require('os').tmpdir();
45
const fs = require('fs');
56
const {execFile} = require('child_process');
67
const tmp = require('tmp');
78
const {waitFile} = require('wait-file');
89

10+
const multiLineDelimiter = randomUUID();
11+
912
console.log("\033[36mPWD: " + process.cwd() + "\033[0m");
1013

1114
tmp.setGracefulCleanup();
@@ -108,7 +111,10 @@ async function main() {
108111
}
109112
});
110113
});
111-
fs.appendFileSync(process.env.GITHUB_OUTPUT, 'helm_output=' + result.trim().split('%').join('%25').split('\n').join('%0A').split('\r').join('%0D') + '\n');
114+
fs.appendFileSync(
115+
process.env.GITHUB_OUTPUT,
116+
`helm_output<<${multiLineDelimiter}\n${result.trim()}\n${multiLineDelimiter}\n`
117+
);
112118
} catch (error) {
113119
process.exit(1);
114120
} finally {

0 commit comments

Comments
 (0)