Skip to content
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

[TECH-133] Add semgrep to pull requests #8

Merged
merged 1 commit into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
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
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"