Skip to content

Commit

Permalink
chore: Enable code scanning via Semgrep
Browse files Browse the repository at this point in the history
  • Loading branch information
96malhar committed Nov 10, 2023
1 parent 3322f01 commit 073a62f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/semgrep-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Semgrep

on:
# Scan changed files in PRs, block on new issues only (existing issues ignored)
pull_request:

push:
branches: ["dev", "main"]

schedule:
- cron: '23 20 * * 1'

# Manually trigger the workflow
workflow_dispatch:

jobs:
semgrep:
name: Scan
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep
# Skip any PR created by dependabot to avoid permission issues
if: (github.actor != 'dependabot[bot]')
steps:
# Fetch project source
- uses: actions/checkout@v4

- run: semgrep scan --sarif --output=semgrep.sarif
env:
SEMGREP_RULES: >- # more at semgrep.dev/explore
p/security-audit
p/secrets
p/owasp-top-ten
- name: Upload SARIF file for GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: semgrep.sarif
if: always()
2 changes: 2 additions & 0 deletions .semgrepignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/sampleapps
/test

0 comments on commit 073a62f

Please sign in to comment.