Skip to content

Commit

Permalink
refactor virus scan
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcongdon committed Oct 14, 2024
1 parent bfbea3b commit ce3ec42
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/virus-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@ jobs:
sudo apt-get update
sudo apt-get install -y clamav clamav-daemon

- name: Configure ClamAV
- name: Disable freshclam logging
run: |
# Comment out the existing UpdateLogFile option
sudo cp /etc/clamav/freshclam.conf /etc/clamav/freshclam.conf.bak
sudo sed -i 's/^UpdateLogFile/#UpdateLogFile/' /etc/clamav/freshclam.conf
# Redirect the log output to /dev/null
echo "UpdateLogFile /dev/null" | sudo tee -a /etc/clamav/freshclam.conf
# Ensure there is no logging defined
grep -q "^LogFile" /etc/clamav/freshclam.conf || echo "LogFile /dev/null" | sudo tee -a /etc/clamav/freshclam.conf

- name: Update ClamAV database
run: sudo freshclam

- name: Restore freshclam logging (if needed)
run: sudo mv /etc/clamav/freshclam.conf.bak /etc/clamav/freshclam.conf

- name: Scan repository for viruses
run: sudo clamscan -r --bell -i .

0 comments on commit ce3ec42

Please sign in to comment.