Skip to content

Commit bffe7c9

Browse files
committed
zizmor: better error handling in checks step
Signed-off-by: CrazyMax <[email protected]>
1 parent 0e0148c commit bffe7c9

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/zizmor.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@ jobs:
4141
return;
4242
}
4343
44-
await github.request('GET /repos/{owner}/{repo}/code-scanning/alerts', {
45-
...context.repo,
46-
}).catch(error => {
47-
if (error.status === 403) {
48-
throw new Error('Advanced Security needs to be enabled on this repository.');
49-
}
50-
});
51-
core.info('Advanced Security is enabled on this repository.');
44+
try {
45+
await github.request('GET /repos/{owner}/{repo}/code-scanning/alerts', {
46+
...context.repo,
47+
}).catch(err => {
48+
if (err.status === 403) {
49+
throw new Error('Advanced Security needs to be enabled on this repository.');
50+
}
51+
});
52+
core.info('Advanced Security is enabled on this repository.');
53+
} catch (err) {
54+
core.setFailed(err.message);
55+
}
5256
-
5357
name: Setup uv
5458
if: ${{ env.HAS_WORKFLOWS }}

0 commit comments

Comments
 (0)