Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Trivy code scan workflow #3

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/code_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Code Scanning

on:
push:
branches:
- releases/*
schedule:
# every UTC 6PM from Mon to Fri
- cron: "0 18 * * 1-5"
workflow_dispatch: # run on request (no need for PR)

# Declare default permissions as read only.
permissions: read-all

jobs:
Trivy-Scan:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install .
pip freeze > requirements.txt
- name: Trivy Scanning
uses: aquasecurity/[email protected]
with:
scan-type: fs
scan-ref: requirements.txt
format: json
output: .tox/trivy-scan-result.spdx.json
- name: Upload Trivy results artifact
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: trivy-scan-results
path: .tox/trivy-scan-results.spdx.json
Loading