Skip to content

Commit

Permalink
use execSync with echo #3481
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-dmlr committed Dec 16, 2024
1 parent d6d7c7d commit 3dd5299
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions github-actions/scan/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29387,8 +29387,10 @@ function setOutput(field, value, dataFormat) {
let valuestring = value.toString();
core.debug(`Output ${field}=${valuestring}`);
const filePath = process.env[`GITHUB_OUTPUT`];
const result = (0,external_child_process_.execSync)('echo "sven=Hello" >> "$GITHUB_OUTPUT"').toString();
console.log(result);
const result1 = (0,external_child_process_.execSync)('echo "${field}=${valuestring}" >> "${filePath}"').toString();
console.log(result1);
const result2 = (0,external_child_process_.execSync)('echo "${field}=${valuestring}"').toString();
console.log(result2);
// if (!filePath) {
// throw new Error(`Empty environment variable GITHUB_OUTPUT`);
// }
Expand Down
6 changes: 4 additions & 2 deletions github-actions/scan/src/post-scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,10 @@ function setOutput(field: string, value: any, dataFormat: string) {
core.debug(`Output ${field}=${valuestring}`);

const filePath = process.env[`GITHUB_OUTPUT`];
const result = execSync('echo "sven=Hello" >> "$GITHUB_OUTPUT"').toString();
console.log(result);
const result1 = execSync('echo "${field}=${valuestring}" >> "${filePath}"').toString();
console.log(result1);
const result2 = execSync('echo "${field}=${valuestring}"').toString();
console.log(result2);
// if (!filePath) {
// throw new Error(`Empty environment variable GITHUB_OUTPUT`);
// }
Expand Down

0 comments on commit 3dd5299

Please sign in to comment.