Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Semgrep OSS scan
on:
pull_request: {}
push:
branches: [main, master]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion (medium): This repo's primary integration branch is staging — all PRs target it, and main only receives merges from staging at release time. Without staging in the push trigger, merged code is only scanned on PR (and again much later when it reaches main). Consider adding it:

Suggested change
branches: [main, master]
branches: [main, staging]

This also drops master, which doesn't exist in this repo.

workflow_dispatch: {}
schedule:
- cron: '0 0 1-7 * 6' # per-repo, staggered across month
concurrency:
group: semgrep-${{ github.event_name }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
semgrep:
name: semgrep-oss
runs-on: ubuntu-slim

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs Fix (medium): ubuntu-slim is not a standard GitHub-hosted runner label (ubuntu-latest, ubuntu-24.04, ubuntu-22.04 are). Every other workflow in this repo uses ubuntu-latest.

If this is a Cloudflare org-wide custom runner label, please disregard — but if not, this will cause the job to hang waiting for a runner that never arrives.

Suggested change
runs-on: ubuntu-slim
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- id: cache-semgrep
uses: actions/cache@v5
with:
path: ~/.local
key: semgrep-1.160.0-${{ runner.os }}
- if: steps.cache-semgrep.outputs.cache-hit != 'true'
run: pip install --user semgrep==1.160.0
- run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: semgrep scan --config=auto
Loading