Skip to content

Commit 6873b2a

Browse files
authored
fail zizmor job on findings (#119)
* fail zizmor job on findings * only fail zizmor on warnings or above
1 parent 11c439d commit 6873b2a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.github/workflows/zizmor.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ jobs:
2828

2929
- name: Set up Rust
3030
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c
31-
31+
- name: Install jq
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y jq
3235
- name: Install Zizmor
3336
run: |
3437
cargo install --locked zizmor
@@ -48,3 +51,12 @@ jobs:
4851
uses: github/codeql-action/upload-sarif@cdefb33c0f6224e58673d9004f47f7cb3e328b89
4952
with:
5053
sarif_file: results.sarif
54+
55+
- name: Fail on Findings
56+
run: |
57+
count="$(
58+
jq '([.runs[]? | (.results // [])[] | select(.level != "note")] | length) // 0' \
59+
results.sarif
60+
)"
61+
echo "Zizmor findings: $count"
62+
test "$count" -eq 0

SECURITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![CodeQL](https://github.com/bckohan/enum-properties/actions/workflows/github-code-scanning/codeql/badge.svg?branch=main)](https://github.com/bckohan/enum-properties/actions/workflows/github-code-scanning/codeql?query=branch:main)
44
[![Zizmor](https://github.com/bckohan/enum-properties/actions/workflows/zizmor.yml/badge.svg?branch=main)](https://docs.zizmor.sh/)
55
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/bckohan/enum-properties/badge)](https://securityscorecards.dev/viewer/?uri=github.com/bckohan/enum-properties)
6+
67
## Supported Versions
78

89
Only the latest version [![PyPI version](https://badge.fury.io/py/enum-properties.svg)](https://pypi.python.org/pypi/enum-properties) is supported.

0 commit comments

Comments
 (0)