Skip to content

Semgrep

Semgrep #32

Workflow file for this run

name: Semgrep
on:
pull_request: {}
workflow_dispatch: {}
push:
branches: ["master", "main"]
schedule:
- cron: '20 5 * * *'
jobs:
semgrep:
name: semgrep/ci
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
container:
image: semgrep/semgrep:latest
options: --memory=4g --cpus="2"
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@v4
- name: Run Semgrep CI with debug
run: |
semgrep ci --sarif > semgrep.sarif || { echo "Semgrep CI failed"; exit 1; }
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
- name: Debug SARIF output
run: |
cat semgrep.sarif || echo "semgrep.sarif file is missing or empty"
- name: Validate SARIF file
run: |
jq . semgrep.sarif
if: always()
- name: Upload SARIF file for GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: semgrep.sarif
if: success() && hashFiles('semgrep.sarif')