mirror of
https://github.com/github/codeql-action.git
synced 2026-04-17 04:23:16 +00:00
Check that stats isn't undefined before trying to call isDirectory
This commit is contained in:
@@ -337,7 +337,11 @@ const baseWorkflowsPath = ".github/workflows";
|
||||
export function hasActionsWorkflows(sourceRoot: string): boolean {
|
||||
const workflowsPath = path.resolve(sourceRoot, baseWorkflowsPath);
|
||||
const stats = fs.lstatSync(workflowsPath);
|
||||
return stats.isDirectory() && fs.readdirSync(workflowsPath).length > 0;
|
||||
return (
|
||||
stats !== undefined &&
|
||||
stats.isDirectory() &&
|
||||
fs.readdirSync(workflowsPath).length > 0
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user