OSV-Scanner Workflow #82
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: OSV-Scanner Workflow | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
pull_request_target: | |
branches: | |
- main | |
schedule: | |
- cron: '38 6 * * 6' # Runs every Saturday at 06:38 UTC | |
permissions: | |
security-events: write | |
contents: read | |
jobs: | |
scan: | |
name: OSV Vulnerability Scan | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set Up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Cache Python Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install OSV Scanner | |
run: | | |
python -m pip install --upgrade pip | |
pip install osv-scanner | |
- name: Run OSV Scanner | |
run: | | |
echo "Running OSV Scanner..." | |
osv-scanner --all | |
- name: Clean Up Pip Cache | |
run: python -m pip cache purge | |
if: always() |