mirror of
https://github.com/github/codeql-action.git
synced 2025-12-24 08:10:06 +08:00
Check that stats isn't undefined before trying to call isDirectory
This commit is contained in:
4
lib/config-utils.js
generated
4
lib/config-utils.js
generated
@@ -160,7 +160,9 @@ const baseWorkflowsPath = ".github/workflows";
|
||||
function hasActionsWorkflows(sourceRoot) {
|
||||
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);
|
||||
}
|
||||
/**
|
||||
* Gets the set of languages in the current repository.
|
||||
|
||||
Reference in New Issue
Block a user