-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.77 KB
/
schedule.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Scheduled Events
on:
schedule:
- cron: "35 */12 * * *"
workflow_dispatch:
jobs:
update:
name: Update Malware Database
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
environment:
name: prod-scheduled
steps:
- name: ⬇️ Set up code
uses: actions/checkout@v4
with:
show-progress: false
repository: GoogleCloudPlatform/docker-clamav-malware-scanner
- name: 🛠️ Create config.json
uses: devops-actions/json-to-file@v1.0.4
with:
json: |
{
"comments": [],
"buckets": [{
"unscanned": "${{ secrets.PROJECT_ID }}-unscanned",
"clean": "${{ secrets.PROJECT_ID }}-documents",
"quarantined": "${{ secrets.PROJECT_ID }}-quarantined"
}],
"ClamCvdMirrorBucket": "${{ secrets.PROJECT_ID }}-cvd-mirror"
}
filename: ./cloudrun-malware-scanner/config.json
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
cache: pip
- name: 🏗 Install modules
run: pip install crcmod cvdupdate
- id: auth
name: 🗝️ Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
create_credentials_file: true
token_format: access_token
workload_identity_provider: ${{ secrets.IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
- name: ☁️ Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: 🔄 Update database
working-directory: ./cloudrun-malware-scanner
run: ./updateCvdMirror.sh "${{ secrets.PROJECT_ID }}-cvd-mirror"