Skip to content

Commit

Permalink
Merge pull request #961 from cohow/add-semgrep
Browse files Browse the repository at this point in the history
feat: add semgrep security issues scanning
  • Loading branch information
rndquu authored Oct 1, 2024
2 parents c5891e9 + 2a1d865 commit 700127f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/run-semgrep.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run Semgrep

on:
workflow_dispatch:
push:
paths:
- '**.sol'
pull_request:
paths:
- '**.sol'

jobs:
semgrep:
name: Scan
runs-on: ubuntu-latest

container:
image: returntocorp/semgrep

if: (github.actor != 'dependabot[bot]')

steps:
- uses: actions/checkout@v3

- name: Fetch semgrep rules
uses: actions/checkout@v3
with:
repository: decurity/semgrep-smart-contracts
path: rules

- run: semgrep ci --sarif --output=semgrep.sarif --include packages/contracts/src/dollar --no-suppress-errors
env:
SEMGREP_RULES: rules/solidity/security

- name: Upload findings to GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: semgrep.sarif
if: always()
8 changes: 8 additions & 0 deletions .semgrepignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# mocks
packages/contracts/src/dollar/mocks/

# deprecated contracts
packages/contracts/src/dollar/core/CreditNft.sol
packages/contracts/src/dollar/core/StakingShare.sol
packages/contracts/src/dollar/libraries/LibCreditNftManager.sol
packages/contracts/src/dollar/libraries/LibDollarMintExcess.sol

0 comments on commit 700127f

Please sign in to comment.