Skip to content

Commit 26b43d5

Browse files
committed
DEBUG: Add verbose output to diagnose scan test failure
1 parent 38aa0d1 commit 26b43d5

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

.github/workflows/test-scan.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,21 @@ jobs:
3838

3939
- name: Run full scan
4040
run: |
41-
docker run --rm -v $GITHUB_WORKSPACE:/scandir gitavscan /gitscan.sh --full | grep "Win.Test.EICAR_HDB-1 FOUND"
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"
4247
4348
- name: Run basic scan
4449
run: |
45-
docker run --rm -v $GITHUB_WORKSPACE:/scandir gitavscan /gitscan.sh | grep "Win.Test.EICAR_HDB-1 FOUND"
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"
4656
4757
- name: Run basic scan with optional args
4858
run: |

gitscan.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ 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..."
7983
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"
8088
if echo "$output" | grep -q "FOUND"; then
8189
echo "Found malicious file in ref $(git rev-parse HEAD)" | tee -a /output.txt
8290
echo "$output" | tee -a /output.txt

0 commit comments

Comments
 (0)