run npm run all

This commit is contained in:
Naoki Oketani
2020-12-12 12:01:55 +00:00
parent c4cd169835
commit 8851061b81
3 changed files with 10 additions and 6 deletions

View File

@@ -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]

View File

@@ -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