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 3dd5299 commit 340239e
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,9 +29387,11 @@ function setOutput(field, value, dataFormat) {
let valuestring = value.toString();
core.debug(`Output ${field}=${valuestring}`);
const filePath = process.env[`GITHUB_OUTPUT`];
const result1 = (0,external_child_process_.execSync)('echo "${field}=${valuestring}" >> "${filePath}"').toString();
let output = 'echo "' + field + '"="' + valuestring + '"';
let o2 = output + " >> $GITHUB_OUTPUT";
const result1 = (0,external_child_process_.execSync)(o2).toString();
console.log(result1);
const result2 = (0,external_child_process_.execSync)('echo "${field}=${valuestring}"').toString();
const result2 = (0,external_child_process_.execSync)(output + " GITHUB_OUTPUT=$GITHUB_OUTPUT").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,9 +285,11 @@ function setOutput(field: string, value: any, dataFormat: string) {
core.debug(`Output ${field}=${valuestring}`);

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

0 comments on commit 340239e

Please sign in to comment.