Skip to content

Commit

Permalink
add slither anaylser to github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
roisindowling committed Jul 12, 2024
1 parent 3cf83ad commit 307ac99
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,27 @@ jobs:
directory: coverage/
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# Run Slither if Solidity changes are detected
- name: Run Slither
uses: crytic/[email protected]
id: slither
if: steps.contract_changes.outputs.src == 'true'
with:
ignore-compile: true
target: "./"
solc-version: "0.8.20"
fail-on: none
slither-args: --filter-paths "openzeppelin" --exclude-informational --exclude-optimization --checklist --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/

- name: Create/update checklist as PR comment
uses: actions/github-script@v7
if: github.event_name == 'pull_request' && steps.contract_changes.outputs.src == 'true'
env:
REPORT: ${{ steps.slither.outputs.stdout }}
with:
script: |
const script = require('.github/scripts/comment')
const header = '# Slither report'
const body = process.env.REPORT
await script({ github, context, header, body })

0 comments on commit 307ac99

Please sign in to comment.