Skip to content

ci: Update semgrep job #128

ci: Update semgrep job

ci: Update semgrep job #128

Workflow file for this run

# This workflow will run security checks against our project
name: Security
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
osv-scanner:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'bump:')"
container:
image: ghcr.io/google/osv-scanner:v2.1.0@sha256:9a1ba57d2a1506c9e9d0dfbeaf46346507e829745b70d47d77e12c38e66de8d7
steps:
- uses: actions/checkout@v4
- name: Run OSV Scanner
run: |
/osv-scanner --format table -r .
semgrep:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'bump:')"
container:
image: returntocorp/semgrep:1.128.1@sha256:fca58525689355641019c05ab49dcc5bc3a1eb7e044f35014ee39594b5aa4fc1
steps:
- uses: actions/checkout@v4
- name: Cache Python files
id: python-files-changes
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.1
with:
key: semgrep-${{ runner.os }}-${{ hashFiles('**/*.py') }}
retention-days: 30
- if: ${{ steps.python-files-changes.outputs.cache-hit != 'true' }}
name: Run Semgrep
run: |
semgrep scan --config auto --error