Use the correct name for allowlists.

This commit is contained in:
Federico Builes
2022-06-14 09:46:59 +02:00
parent b0e1f384d7
commit f83a407eb9
4 changed files with 6 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ beforeEach(() => {
// reset to our defaults after every test run
// TODO find out what the proper way of passing action inputs in tests is
delete process.env['INPUT_FAIL-ON-SEVERITY']
delete process.env['INPUT_ALLOWED-LICENSES']
delete process.env['INPUT_ALLOW-LICENSES']
delete process.env['INPUT_DENY-LICENSES']
})
@@ -17,7 +17,7 @@ test('it defaults to low severity', async () => {
test('it reads custom configs', async () => {
process.env['INPUT_FAIL-ON-SEVERITY'] = 'critical'
process.env['INPUT_ALLOWED-LICENSES'] = ' BSD, GPL 2 '
process.env['INPUT_ALLOW-LICENSES'] = ' BSD, GPL 2 '
const options = readConfig()
expect(options.fail_on_severity).toEqual('critical')
@@ -32,7 +32,7 @@ test('it defaults to empty allow/deny lists ', async () => {
})
test('it raises an error if both an allow and denylist are specified', async () => {
process.env['INPUT_ALLOWED-LICENSES'] = 'MIT'
process.env['INPUT_ALLOW-LICENSES'] = 'MIT'
process.env['INPUT_DENY-LICENSES'] = 'BSD'
expect(() => readConfig()).toThrow()
})

2
dist/index.js generated vendored
View File

@@ -13699,7 +13699,7 @@ function readConfig() {
let options = {};
// By default we want to fail on all severities and allow all licenses.
const severity = core.getInput('fail-on-severity') || 'low';
const allowedLicenses = core.getInput('allowed-licenses');
const allowedLicenses = core.getInput('allow-licenses');
const denyLicenses = core.getInput('deny-licenses');
options.fail_on_severity = severity.toLowerCase();
if (allowedLicenses.length > 0) {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -10,7 +10,7 @@ export function readConfig(): ConfigurationOptions {
// By default we want to fail on all severities and allow all licenses.
const severity = core.getInput('fail-on-severity') || 'low'
const allowedLicenses = core.getInput('allowed-licenses')
const allowedLicenses = core.getInput('allow-licenses')
const denyLicenses = core.getInput('deny-licenses')
options.fail_on_severity = severity.toLowerCase() as Severity