|
1 | | -import { endGroup, info, startGroup } from '@actions/core' |
| 1 | +import { endGroup, startGroup } from '@actions/core' |
2 | 2 | import { context } from '@actions/github' |
3 | 3 | import { existsSync, readFileSync } from 'fs' |
4 | | -import { Log } from 'sarif' |
5 | 4 | import { simpleGit, SimpleGitOptions } from 'simple-git' |
6 | 5 | import { getPrApi } from './actions' |
7 | 6 | import { LWJSON } from './lw-json' |
8 | 7 | import { callLaceworkCli, debug, getOptionalEnvVariable, getRequiredEnvVariable } from './util' |
9 | 8 |
|
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 | | - |
29 | 9 | export function splitStringAtFirstSlash(inputString: string | undefined): [string, string] { |
30 | 10 | if (inputString != null) { |
31 | 11 | const [firstPart, secondPart] = inputString.split('/', 2) |
|
0 commit comments