Skip to content

Commit 57bf2db

Browse files
committed
Ensure ClamAV workflow validates EICAR detection
1 parent f658d8b commit 57bf2db

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/clam-av.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,15 @@ jobs:
4343
# Scan extracted bundle so counts reflect actual files
4444
- name: Verify ClamAV detects EICAR signature
4545
run: |
46-
set -e
46+
set -euo pipefail
4747
printf 'X5O!P%%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' > eicar.com
48-
clamscan eicar.com | tee eicar.log
48+
status=0
49+
clamscan eicar.com > eicar.log || status=$?
50+
cat eicar.log
51+
if [ "$status" -ne 1 ]; then
52+
echo "ClamAV failed to report the EICAR signature" >&2
53+
exit 1
54+
fi
4955
grep -q 'eicar.com: Eicar-Test-Signature FOUND' eicar.log
5056
grep -q 'Infected files: 1' eicar.log
5157
rm -f eicar.com eicar.log

0 commit comments

Comments
 (0)