diff --git a/__tests__/config.test.ts b/__tests__/config.test.ts index 5d25d0d..c46446f 100644 --- a/__tests__/config.test.ts +++ b/__tests__/config.test.ts @@ -215,6 +215,14 @@ test('it parses the vulnerability-check input', async () => { expect(options.vulnerability_check).toEqual(true) }) +test('it is not impossible to disable both checks', async () => { + setInput('license-check', 'false') + setInput('vulnerability-check', 'false') + expect(() => { + readConfig() + }).toThrow("Can't disable both license-check and vulnerability-check") +}) + describe('licenses that are not valid SPDX licenses', () => { beforeAll(() => { jest.spyOn(Utils, 'isSPDXValid').mockReturnValue(false) diff --git a/src/config.ts b/src/config.ts index 780738a..908b86d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -90,6 +90,9 @@ export function readInlineConfig(): ConfigurationOptions { .boolean() .default(true) .parse(getOptionalBoolean('vulnerability-check')) + if (license_check === false && vulnerability_check === false) { + throw new Error("Can't disable both license-check and vulnerability-check") + } const base_ref = getOptionalInput('base-ref') const head_ref = getOptionalInput('head-ref')