Skip to content

Commit

Permalink
[TECH-133] Add semgrep to pull requests (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zav authored Jan 18, 2023
1 parent 26c5787 commit b3a37b1
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 35 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/codeql.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/semgrep-full-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Semgrep Full Scan

on:
workflow_dispatch:
branches:
- main
schedule:
- cron: '0 9 * * 6'

jobs:
semgrep-full:
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep

steps:
- name: clone application source code
uses: actions/checkout@v3

- name: full scan
run: |
semgrep \
--sarif --output report.sarif \
--metrics=off \
--config="p/default"
- name: save report as pipeline artifact
uses: actions/upload-artifact@v3
with:
name: report.sarif
path: report.sarif

- name: publish code scanning alerts
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: report.sarif
category: semgrep
25 changes: 25 additions & 0 deletions .github/workflows/semgrep-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Semgrep Pull Request Scan
on:
pull_request:
branches: [ "main" ]

jobs:
semgrep-diff:
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep

steps:
- name: clone application source code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: pull request scan
run: |
semgrep scan \
--error \
--verbose \
--time \
--baseline-commit ${{ github.event.pull_request.base.sha }} \
--config="p/default"

0 comments on commit b3a37b1

Please sign in to comment.