initial commit
This commit is contained in:
@@ -33,6 +33,7 @@ function readInlineConfig(): ConfigurationOptionsPartial {
|
|||||||
const allow_dependencies_licenses = parseList(
|
const allow_dependencies_licenses = parseList(
|
||||||
getOptionalInput('allow-dependencies-licenses')
|
getOptionalInput('allow-dependencies-licenses')
|
||||||
)
|
)
|
||||||
|
const deny_list = parseList(getOptionalInput('deny-dependencies'))
|
||||||
const allow_ghsas = parseList(getOptionalInput('allow-ghsas'))
|
const allow_ghsas = parseList(getOptionalInput('allow-ghsas'))
|
||||||
const license_check = getOptionalBoolean('license-check')
|
const license_check = getOptionalBoolean('license-check')
|
||||||
const vulnerability_check = getOptionalBoolean('vulnerability-check')
|
const vulnerability_check = getOptionalBoolean('vulnerability-check')
|
||||||
@@ -49,6 +50,7 @@ function readInlineConfig(): ConfigurationOptionsPartial {
|
|||||||
fail_on_scopes,
|
fail_on_scopes,
|
||||||
allow_licenses,
|
allow_licenses,
|
||||||
deny_licenses,
|
deny_licenses,
|
||||||
|
deny_list,
|
||||||
allow_dependencies_licenses,
|
allow_dependencies_licenses,
|
||||||
allow_ghsas,
|
allow_ghsas,
|
||||||
license_check,
|
license_check,
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {getRefs} from './git-refs'
|
|||||||
|
|
||||||
import {groupDependenciesByManifest} from './utils'
|
import {groupDependenciesByManifest} from './utils'
|
||||||
import {commentPr} from './comment-pr'
|
import {commentPr} from './comment-pr'
|
||||||
|
import {getDeniedChanges} from './denylist'
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
@@ -63,9 +64,15 @@ async function run(): Promise<void> {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const deniedChanges = await getDeniedChanges(
|
||||||
|
filteredChanges,
|
||||||
|
config.deny_list
|
||||||
|
)
|
||||||
|
|
||||||
summary.addSummaryToSummary(
|
summary.addSummaryToSummary(
|
||||||
vulnerableChanges,
|
vulnerableChanges,
|
||||||
invalidLicenseChanges,
|
invalidLicenseChanges,
|
||||||
|
deniedChanges,
|
||||||
config
|
config
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export const ConfigurationOptionsSchema = z
|
|||||||
deny_licenses: z.array(z.string()).optional(),
|
deny_licenses: z.array(z.string()).optional(),
|
||||||
allow_dependencies_licenses: z.array(z.string()).optional(),
|
allow_dependencies_licenses: z.array(z.string()).optional(),
|
||||||
allow_ghsas: z.array(z.string()).default([]),
|
allow_ghsas: z.array(z.string()).default([]),
|
||||||
|
deny_list: z.array(z.string()).default([]),
|
||||||
license_check: z.boolean().default(true),
|
license_check: z.boolean().default(true),
|
||||||
vulnerability_check: z.boolean().default(true),
|
vulnerability_check: z.boolean().default(true),
|
||||||
config_file: z.string().optional(),
|
config_file: z.string().optional(),
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const icons = {
|
|||||||
export function addSummaryToSummary(
|
export function addSummaryToSummary(
|
||||||
vulnerableChanges: Changes,
|
vulnerableChanges: Changes,
|
||||||
invalidLicenseChanges: InvalidLicenseChanges,
|
invalidLicenseChanges: InvalidLicenseChanges,
|
||||||
|
deniedChanges: Changes,
|
||||||
config: ConfigurationOptions
|
config: ConfigurationOptions
|
||||||
): void {
|
): void {
|
||||||
core.summary.addHeading('Dependency Review', 1)
|
core.summary.addHeading('Dependency Review', 1)
|
||||||
@@ -34,6 +35,8 @@ export function addSummaryToSummary(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
core.summary.addList(deniedChanges.map(change => `${change.name} is denied`))
|
||||||
|
|
||||||
core.summary
|
core.summary
|
||||||
.addRaw('The following issues were found:')
|
.addRaw('The following issues were found:')
|
||||||
.addList([
|
.addList([
|
||||||
|
|||||||
Reference in New Issue
Block a user