diff --git a/test/e2e/entrypoint.test.js b/test/e2e/entrypoint.test.js index 4c4006f..a7c684f 100644 --- a/test/e2e/entrypoint.test.js +++ b/test/e2e/entrypoint.test.js @@ -216,8 +216,8 @@ test('whole action: entrypoint, KICS, JavaScript stage and GitHub', async (t) => assert.match(run.summary, /\| TOTAL \| 4 \|/, run.stdout + run.stderr) }) - await t.test('results.json is left readable for the next workflow steps', knownBug('KICS runs as root and writes mode 600, so later steps and upload-sarif cannot read it (#130)'), async (t) => { - const run = await runEntrypoint(t, { results: kicsResults(), resultsMode: '600' }) + await t.test('results.json is left readable for the next workflow steps', async (t) => { + const run = await runEntrypoint(t, { results: kicsResults() }) const mode = fs.statSync(path.join(run.workspace, 'results.json')).mode assert.notEqual(mode & 0o044, 0, `mode is ${(mode & 0o777).toString(8)}`) }) diff --git a/test/helpers/run-entrypoint.js b/test/helpers/run-entrypoint.js index 1bddb81..27550cb 100644 --- a/test/helpers/run-entrypoint.js +++ b/test/helpers/run-entrypoint.js @@ -36,7 +36,7 @@ if [ -n "$FAKE_KICS_RESULTS" ]; then mkdir -p "$out" file="$out/\${FAKE_KICS_NAME:-results}.json" cp "$FAKE_KICS_RESULTS" "$file" - if [ -n "$FAKE_KICS_MODE" ]; then chmod "$FAKE_KICS_MODE" "$file"; fi + chmod 755 "$file" # KICS v2.1.20 writes its reports world-readable fi exit "\${FAKE_KICS_EXIT:-0}" ` @@ -51,7 +51,7 @@ function write(file, content, mode) { fs.writeFileSync(file, content, { mode }) } -async function runEntrypoint(t, { inputs = {}, results, kicsExitCode = 0, runMain = false, apiUrl, workspaceFiles = {}, resultsName, resultsMode } = {}) { +async function runEntrypoint(t, { inputs = {}, results, kicsExitCode = 0, runMain = false, apiUrl, workspaceFiles = {}, resultsName } = {}) { const sandbox = fs.mkdtempSync(path.join(os.tmpdir(), 'kics-entrypoint-')) t.after(() => fs.rmSync(sandbox, { recursive: true, force: true })) @@ -81,7 +81,6 @@ async function runEntrypoint(t, { inputs = {}, results, kicsExitCode = 0, runMai FAKE_KICS_RESULTS: resultsFile, FAKE_KICS_EXIT: String(kicsExitCode), FAKE_KICS_NAME: resultsName ?? '', - FAKE_KICS_MODE: resultsMode ?? '', REAL_NODE: process.execPath, MAIN_JS, }