-
Notifications
You must be signed in to change notification settings - Fork 22
ci: add Semgrep OSS scanning workflow #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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] | ||||||
| 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 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs Fix (medium): 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
|
||||||
| 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 | ||||||
There was a problem hiding this comment.
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, andmainonly receives merges fromstagingat release time. Withoutstagingin the push trigger, merged code is only scanned on PR (and again much later when it reachesmain). Consider adding it:This also drops
master, which doesn't exist in this repo.