Skip to content

Semgrep scan

Semgrep scan #155

Workflow file for this run

name: Semgrep scan
on:
pull_request:
branches: [main]
workflow_dispatch: {}
schedule:
- cron: "32 7 * * 6"
jobs:
semgrep:
runs-on: ubuntu-latest
permissions:
security-events: write
container:
image: returntocorp/semgrep@sha256:83533e3e4fc2dccad814760e96555743adf6aba9328b9b5eb2ddccc0979d4da4
steps:
- name: Checkout all commits and tags
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
if: ${{ github.event_name == 'pull_request' }}
with:
fetch-depth: 0
- name: Checkout single commit
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
if: ${{ github.event_name != 'pull_request' }}
- name: Pull request scan
if: ${{ github.event_name == 'pull_request' }}
run: semgrep scan --config=auto --verbose --time --error --baseline-commit ${{ github.event.pull_request.base.sha }}
- name: Full scan
if: ${{ github.event_name != 'pull_request' }}
run: semgrep scan --config=auto --verbose --time --sarif --output report.sarif
- name: Save report as pipeline artifact
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
with:
name: report.sarif
path: report.sarif
- name: Publish code scanning alerts
if: ${{ github.event_name != 'pull_request' }}
uses: github/codeql-action/upload-sarif@379614612a29c9e28f31f39a59013eb8012a51f0 # v3
with:
sarif_file: report.sarif
category: semgrep