Move config into its own file.

This commit is contained in:
Federico Builes
2022-05-12 18:05:14 +02:00
parent fdcc204dbb
commit 0e9a322413
2 changed files with 34 additions and 15 deletions
+4 -15
View File
@@ -2,9 +2,9 @@ import * as core from '@actions/core'
import * as dependencyGraph from './dependency-graph'
import * as github from '@actions/github'
import styles from 'ansi-styles'
import {RequestError} from '@octokit/request-error'
import {PullRequestSchema} from './schemas'
import * as fs from 'fs'
import { RequestError } from '@octokit/request-error'
import { PullRequestSchema } from './schemas'
async function run(): Promise<void> {
try {
@@ -35,8 +35,7 @@ async function run(): Promise<void> {
) {
for (const vuln of change.vulnerabilities) {
core.info(
`${styles.bold.open}${change.manifest} » ${change.name}@${
change.version
`${styles.bold.open}${change.manifest} » ${change.name}@${change.version
}${styles.bold.close} ${vuln.advisory_summary} ${renderSeverity(
vuln.severity
)}`
@@ -47,16 +46,6 @@ async function run(): Promise<void> {
}
}
// TODO check for file not existing
// TODO check for file with both extensions
var severity: string
var allowlist, blocklist: [string]
var data = fs.readFile("./.github/dep-review.yml", "utf-8", (err, data) => {
core.info(data)
})
if (failed) {
throw new Error('Dependency review detected vulnerable packages.')
} else {