Skip to content

Commit edec459

Browse files
authored
stop showing Fuzz action failure on success (#6833)
Annoyingly, our Fuzz CI action always shows as failing even when it's succeeding: <img width="1356" height="961" alt="image" src="https://github.com/user-attachments/assets/4bf98e7d-8249-41b6-84d4-8b2b9abcf448" /> We're checking for the wrong thing to determine if there were crashes. The `artifacts` dir is always created when you run the fuzzer. We should be checking if there are any crash files in there. Signed-off-by: Andrew Duffy <andrew@a10y.dev>
1 parent 4cbfb33 commit edec459

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

.github/workflows/run-fuzzer.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,18 @@ jobs:
119119
- name: Check for crashes
120120
id: check
121121
run: |
122-
if [ -d "fuzz/artifacts" ] && [ "$(ls -A fuzz/artifacts 2>/dev/null)" ]; then
123-
echo "crashes_found=true" >> $GITHUB_OUTPUT
124-
125-
# Get the first crash file only
126-
FIRST_CRASH=$(find fuzz/artifacts -type f \( -name "crash-*" -o -name "leak-*" -o -name "timeout-*" -o -name "oom-*" \) | head -1)
122+
# Find actual crash files, not just the directory structure
123+
FIRST_CRASH=$(find fuzz/artifacts -type f \( -name "crash-*" -o -name "leak-*" -o -name "timeout-*" -o -name "oom-*" \) 2>/dev/null | head -1 || true)
127124
128-
if [ -n "$FIRST_CRASH" ]; then
129-
echo "first_crash=$FIRST_CRASH" >> $GITHUB_OUTPUT
130-
echo "first_crash_name=$(basename $FIRST_CRASH)" >> $GITHUB_OUTPUT
125+
if [ -n "$FIRST_CRASH" ]; then
126+
echo "crashes_found=true" >> $GITHUB_OUTPUT
127+
echo "first_crash=$FIRST_CRASH" >> $GITHUB_OUTPUT
128+
echo "first_crash_name=$(basename $FIRST_CRASH)" >> $GITHUB_OUTPUT
131129
132-
# Count all crashes for reporting
133-
CRASH_COUNT=$(find fuzz/artifacts -type f \( -name "crash-*" -o -name "leak-*" -o -name "timeout-*" -o -name "oom-*" \) | wc -l)
134-
echo "crash_count=$CRASH_COUNT" >> $GITHUB_OUTPUT
135-
echo "Found $CRASH_COUNT crash(es), will process first: $(basename $FIRST_CRASH)"
136-
fi
130+
# Count all crashes for reporting
131+
CRASH_COUNT=$(find fuzz/artifacts -type f \( -name "crash-*" -o -name "leak-*" -o -name "timeout-*" -o -name "oom-*" \) | wc -l)
132+
echo "crash_count=$CRASH_COUNT" >> $GITHUB_OUTPUT
133+
echo "Found $CRASH_COUNT crash(es), will process first: $(basename $FIRST_CRASH)"
137134
else
138135
echo "crashes_found=false" >> $GITHUB_OUTPUT
139136
echo "crash_count=0" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)