diff --git a/.github/dr-action.yml b/.github/dr-action.yml new file mode 100644 index 0000000..d466c24 --- /dev/null +++ b/.github/dr-action.yml @@ -0,0 +1,8 @@ +fail_on_severity: critical +allow_licenses: + - "GPL 3.0" + - "BSD 3 Clause" + - "MIT" +deny_licenses: + - "LGPL 2.0" + - "BSD 2 Clause" \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index bf8fb22..406e6c8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,6 +4,7 @@ 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' async function run(): Promise { try { @@ -46,6 +47,16 @@ async function run(): Promise { } } + // 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 {