Skip to content

🚨 Semgrep Analysis #1556

🚨 Semgrep Analysis

🚨 Semgrep Analysis #1556

Workflow file for this run

---
name: 🚨 Semgrep Analysis
on:
merge_group:
pull_request:
branches:
- main
- feat/more-attack-cov
types:
- opened
- synchronize
- reopened
push:
branches:
- main
schedule:
- cron: "0 0 * * *" # Run daily at midnight UTC
concurrency:
group: semgrep-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: read
checks: write
contents: read
pull-requests: write # Allows merge queue updates
security-events: write # Required for GitHub Security tab
jobs:
semgrep:
name: 🚨 Semgrep Analysis
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep@sha256:06938c1f365d3f67b8cedd8bc117607ae64253f88a0e768e9da9408548927dd6
# Skip any PR created by dependabot to avoid permission issues:
if: (github.actor != 'dependabot[bot]')
steps:
- name: Set up git repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git Safe Directory
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Semgrep Analysis
env:
SEMGREP_RULES: >-
p/rust
p/python
p/github-actions
p/security-audit
p/secrets
p/owasp-top-ten
p/supply-chain
SEMGREP_TIMEOUT: 300 # 5-minute timeout per rule
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
semgrep ci \
--config="${SEMGREP_RULES}" \
--timeout="${SEMGREP_TIMEOUT}" \
--sarif --output=semgrep-results.sarif
- name: Upload SARIF to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
with:
sarif_file: semgrep-results.sarif
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}