Skip to content

Commit 16082d7

Browse files
Merge pull request #6 from docker/tthede.readdirSync
Check whether workflow directory exists
2 parents 0db637a + a60c97d commit 16082d7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Diff for: .github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @crazy-max @temenuzhka-thede
1+
* @docker/devsecops

Diff for: .github/workflows/octoguard.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ jobs:
3434
with:
3535
script: |
3636
const fs = require('fs');
37+
const workflowsPath = '.github/workflows';
38+
if (!fs.existsSync(workflowsPath)){
39+
core.warning("No workflow directory found, skipping zizmor scan.");
40+
return;
41+
}
3742
38-
const workflows = fs.readdirSync('.github/workflows').filter(file => file.endsWith('.yml') || file.endsWith('.yaml'));
43+
const workflows = fs.readdirSync(workflowsPath).filter(file => file.endsWith('.yml') || file.endsWith('.yaml'));
3944
if (workflows.length > 0) {
4045
core.info(`${workflows.length} workflows found in this repository.`);
4146
core.exportVariable('HAS_WORKFLOWS', 'true');

0 commit comments

Comments
 (0)