generated from VeeamHub/veeamhub-template
-
Notifications
You must be signed in to change notification settings - Fork 10
40 lines (32 loc) · 1.03 KB
/
virus-scan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Virus Scan
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
jobs:
virus-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install ClamAV
run: |
sudo apt-get update
sudo apt-get install -y clamav clamav-daemon
- name: Disable freshclam logging
run: |
sudo cp /etc/clamav/freshclam.conf /etc/clamav/freshclam.conf.bak
sudo sed -i 's/^UpdateLogFile/#UpdateLogFile/' /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 .