2022-01-24 14:35:02 +00:00
|
|
|
name: Semgrep
|
|
|
|
on:
|
|
|
|
# Scan changed files in PRs, block on new issues only (existing issues ignored)
|
|
|
|
pull_request: {}
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- .github/workflows/semgrep.yml
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * 0'
|
|
|
|
jobs:
|
2022-06-22 08:28:23 +00:00
|
|
|
# Update from: https://semgrep.dev/docs/semgrep-ci/sample-ci-configs/#github-actions
|
2022-01-24 14:35:02 +00:00
|
|
|
semgrep:
|
|
|
|
name: Scan
|
|
|
|
runs-on: ubuntu-latest
|
2022-06-22 08:28:23 +00:00
|
|
|
container:
|
|
|
|
image: returntocorp/semgrep
|
2022-01-24 14:35:02 +00:00
|
|
|
if: (github.actor != 'dependabot[bot]')
|
|
|
|
steps:
|
2022-06-27 17:50:24 +00:00
|
|
|
- name: Permission issue fix
|
|
|
|
run: git config --global --add safe.directory /__w/ethermint/ethermint
|
2022-03-03 17:07:19 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-24 14:35:02 +00:00
|
|
|
- name: Get Diff
|
2022-10-18 13:57:31 +00:00
|
|
|
uses: technote-space/get-diff-action@v6.1.1
|
2022-01-24 14:35:02 +00:00
|
|
|
with:
|
|
|
|
PATTERNS: |
|
|
|
|
**/*.go
|
|
|
|
**/*.js
|
|
|
|
**/*.ts
|
|
|
|
**/*.sol
|
|
|
|
go.mod
|
|
|
|
go.sum
|
2022-06-22 08:28:23 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-10-14 22:50:01 +00:00
|
|
|
- run: semgrep scan --sarif --output=semgrep.sarif --config auto
|
2022-06-22 08:28:23 +00:00
|
|
|
env:
|
|
|
|
# Upload findings to GitHub Advanced Security Dashboard [step 1/2]
|
|
|
|
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
|
2022-01-24 14:35:02 +00:00
|
|
|
if: "env.GIT_DIFF_FILTERED != ''"
|
|
|
|
# Upload findings to GitHub Advanced Security Dashboard [step 2/2]
|
2022-04-12 13:51:20 +00:00
|
|
|
- name: Upload SARIF file
|
2022-04-26 11:03:36 +00:00
|
|
|
uses: github/codeql-action/upload-sarif@v2
|
2022-01-24 14:35:02 +00:00
|
|
|
with:
|
|
|
|
sarif_file: semgrep.sarif
|
|
|
|
if: "env.GIT_DIFF_FILTERED != ''"
|