fix: type guard for catched error

This commit is contained in:
Naoki Oketani
2022-12-11 12:58:32 +09:00
parent 6302adc652
commit 153cdc3701

View File

@@ -114,8 +114,10 @@ export async function run(): Promise<void> {
core.setFailed('This repo has some vulnerabilities')
}
}
} catch (error) {
core.setFailed(error.message)
} catch (e: unknown) {
if (e instanceof Error) {
core.setFailed(e.message)
}
}
}