Skip to content

Commit 7fec270

Browse files
committed
Allow ClamAV workflow to tolerate EICAR detections
1 parent 73dfbda commit 7fec270

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/clam-av.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,20 @@ jobs:
5858
5959
- name: Extract bundle and scan
6060
run: |
61-
set -e
61+
set -euo pipefail
6262
rm -rf scan && mkdir -p scan
6363
unzip -q bundle/opencode.zip -d scan
6464
echo "File count in payload: $(find scan -type f | wc -l)"
6565
clamscan -ri --scan-archive=yes scan | tee clamav.log
66-
! grep -qE 'Infected files: [1-9][0-9]*' clamav.log
66+
if grep -qE 'Infected files: [1-9][0-9]*' clamav.log; then
67+
findings=$(grep 'FOUND' clamav.log | grep -v 'Eicar-Test-Signature' || true)
68+
if [ -n "${findings}" ]; then
69+
echo "Unexpected detections found:" >&2
70+
echo "${findings}" >&2
71+
exit 1
72+
fi
73+
echo 'Only EICAR detections observed; continuing.'
74+
fi
6775
6876
- name: Upload scan results
6977
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)