feat: add the ability to run with '--production' (#75)
* feat: add the ability to run with '--production' Adding the config options to run npm audit with the --production flag. Contributes to: #74 Signed-off-by: Stelios Gkiokas <s_giokas@hotmail.com> * fix: add tests Adding the relevant tests for the new production flag. Contributes to: #74 Signed-off-by: Stelios Gkiokas <s_giokas@hotmail.com>
This commit is contained in:
@@ -25,9 +25,14 @@ export async function run(): Promise<void> {
|
||||
throw new Error('Invalid input: audit_level')
|
||||
}
|
||||
|
||||
const productionFlag = core.getInput('production_flag', {required: false});
|
||||
if (!['true', 'false'].includes(productionFlag)) {
|
||||
throw new Error('Invalid input: production_flag')
|
||||
}
|
||||
|
||||
// run `npm audit`
|
||||
const audit = new Audit()
|
||||
audit.run(auditLevel)
|
||||
audit.run(auditLevel, productionFlag)
|
||||
core.info(audit.stdout)
|
||||
|
||||
if (audit.foundVulnerability()) {
|
||||
|
||||
Reference in New Issue
Block a user