Skip to content

Commit e675d35

Browse files
committed
Fix test: search for 'FOUND' instead of old signature name
ClamAV now reports EICAR as 'Eicar-Test-Signature FOUND' instead of 'Win.Test.EICAR_HDB-1 FOUND'. Updated tests to search for 'FOUND' which works with any detection name. Also removed debug output from gitscan.sh.
1 parent ce57ddd commit e675d35

2 files changed

Lines changed: 3 additions & 21 deletions

File tree

.github/workflows/test-scan.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,15 @@ jobs:
3838

3939
- name: Run full scan
4040
run: |
41-
set +e
42-
output=$(docker run --rm -v $GITHUB_WORKSPACE:/scandir gitavscan /gitscan.sh --full 2>&1)
43-
echo "=== Full scan output ==="
44-
echo "$output"
45-
echo "=== End output ==="
46-
echo "$output" | grep "Win.Test.EICAR_HDB-1 FOUND"
41+
docker run --rm -v $GITHUB_WORKSPACE:/scandir gitavscan /gitscan.sh --full | grep "FOUND"
4742
4843
- name: Run basic scan
4944
run: |
50-
set +e
51-
output=$(docker run --rm -v $GITHUB_WORKSPACE:/scandir gitavscan /gitscan.sh 2>&1)
52-
echo "=== Basic scan output ==="
53-
echo "$output"
54-
echo "=== End output ==="
55-
echo "$output" | grep "Win.Test.EICAR_HDB-1 FOUND"
45+
docker run --rm -v $GITHUB_WORKSPACE:/scandir gitavscan /gitscan.sh | grep "FOUND"
5646
5747
- name: Run basic scan with optional args
5848
run: |
59-
docker run --rm -v $GITHUB_WORKSPACE:/scandir gitavscan /gitscan.sh --options "--max-filesize=1M --max-files=15" | grep "Win.Test.EICAR_HDB-1 FOUND"
49+
docker run --rm -v $GITHUB_WORKSPACE:/scandir gitavscan /gitscan.sh --options "--max-filesize=1M --max-files=15" | grep "FOUND"
6050
6151
- name: Test unknown option
6252
run: |

gitscan.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,7 @@ EXCLUDE="--exclude=/.git"
7676
REPO=$(pwd)
7777

7878
echo "Scanning working directory..."
79-
echo "DEBUG: pwd=$(pwd)"
80-
echo "DEBUG: ls output:"
81-
ls -la
82-
echo "DEBUG: Running clamscan..."
8379
output=$(/usr/bin/clamscan -ri --no-summary $ADDITIONAL_OPTIONS .)
84-
echo "DEBUG: clamscan exit code: $?"
85-
echo "DEBUG: output length: ${#output}"
86-
echo "DEBUG: output content:"
87-
echo "$output"
8880
if echo "$output" | grep -q "FOUND"; then
8981
echo "Found malicious file in ref $(git rev-parse HEAD)" | tee -a /output.txt
9082
echo "$output" | tee -a /output.txt

0 commit comments

Comments
 (0)