Scheduled Events #801
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | |
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" |