Skip to content

Commit f0dbac6

Browse files
fix(COD-5581): no longer print the list of findings in the action output (#229)
1 parent a502f35 commit f0dbac6

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
uploadArtifact,
88
} from './actions'
99
import { downloadKeys, trustedKeys } from './keys'
10-
import { compareResults, printResults } from './tool'
10+
import { compareResults } from './tool'
1111
import {
1212
callCommand,
1313
callLaceworkCli,
@@ -74,7 +74,6 @@ async function runAnalysis() {
7474
args = [scaSarifReport, scaReport]
7575
await callCommand('cp', ...args)
7676

77-
await printResults('sca', scaReport)
7877
toUpload.push(scaReport)
7978

8079
const uploadStart = Date.now()

src/tool.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
1-
import { endGroup, info, startGroup } from '@actions/core'
1+
import { endGroup, startGroup } from '@actions/core'
22
import { context } from '@actions/github'
33
import { existsSync, readFileSync } from 'fs'
4-
import { Log } from 'sarif'
54
import { simpleGit, SimpleGitOptions } from 'simple-git'
65
import { getPrApi } from './actions'
76
import { LWJSON } from './lw-json'
87
import { callLaceworkCli, debug, getOptionalEnvVariable, getRequiredEnvVariable } from './util'
98

10-
export async function printResults(tool: string, sarifFile: string) {
11-
startGroup(`Results for ${tool}`)
12-
let foundSomething = false
13-
const results: Log = JSON.parse(readFileSync(sarifFile, 'utf8'))
14-
for (const run of results.runs) {
15-
if (Array.isArray(run.results) && run.results.length > 0) {
16-
foundSomething = true
17-
info('Found ' + run.results?.length + ' results using ' + tool)
18-
for (const vuln of run.results) {
19-
info(JSON.stringify(vuln, null, 2))
20-
}
21-
}
22-
}
23-
if (!foundSomething) {
24-
info(`No ${tool} issues were found`)
25-
}
26-
endGroup()
27-
}
28-
299
export function splitStringAtFirstSlash(inputString: string | undefined): [string, string] {
3010
if (inputString != null) {
3111
const [firstPart, secondPart] = inputString.split('/', 2)

0 commit comments

Comments
 (0)