run npm run all
This commit is contained in:
@@ -7,7 +7,11 @@ export class Audit {
|
||||
stdout = ''
|
||||
private status: number | null = null
|
||||
|
||||
public run(auditLevel: string, productionFlag: string, jsonFlag: string): void {
|
||||
public run(
|
||||
auditLevel: string,
|
||||
productionFlag: string,
|
||||
jsonFlag: string
|
||||
): void {
|
||||
try {
|
||||
const auditOptions: Array<string> = ['audit', '--audit-level', auditLevel]
|
||||
|
||||
|
||||
@@ -35,12 +35,11 @@ export async function run(): Promise<void> {
|
||||
throw new Error('Invalid input: json_flag')
|
||||
}
|
||||
|
||||
|
||||
// run `npm audit`
|
||||
const audit = new Audit()
|
||||
audit.run(auditLevel, productionFlag, jsonFlag)
|
||||
core.info(audit.stdout)
|
||||
core.setOutput('npm_audit', audit.stdout);
|
||||
core.setOutput('npm_audit', audit.stdout)
|
||||
|
||||
if (audit.foundVulnerability()) {
|
||||
// vulnerabilities are found
|
||||
|
||||
Reference in New Issue
Block a user