Adding logic to filter by vulnerability severity.

This commit is contained in:
Federico Builes
2022-05-31 16:50:39 +02:00
parent e622e72c6f
commit f0a04841ce
8 changed files with 8510 additions and 8 deletions
+4 -6
View File
@@ -1,13 +1,12 @@
import * as fs from 'fs'
import * as core from '@actions/core'
import YAML from 'yaml'
import * as z from 'zod'
import path from 'path'
import { type } from 'os'
export type Severity = "critical" | "high" | "moderate" | "low"
const CONFIG_FILEPATH = "./.github/dep-review.yml"
const SEVERITIES = ["critical", "high", "moderate", "low"] as const
export const SEVERITIES = ["critical", "high", "moderate", "low"] as const
export const CONFIG_FILEPATH = "./.github/dep-review.yml"
type ConfigurationOptions = {
fail_on_severity: string,
@@ -24,7 +23,6 @@ export function readConfigFile(filePath: string = CONFIG_FILEPATH): Configuratio
}
try {
console.log(path.resolve(filePath))
var data = fs.readFileSync(path.resolve(filePath), "utf-8");
} catch (error: any) {
@@ -47,4 +45,4 @@ export function readConfigFile(filePath: string = CONFIG_FILEPATH): Configuratio
.parse(values)
return <ConfigurationOptions>parsed;
}
}