Skip to content

ci(slither): run only on solidity files changed #41

ci(slither): run only on solidity files changed

ci(slither): run only on solidity files changed #41

Workflow file for this run

name: Slither Analysis
on: [push]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
solidity:
- 'ethereum-bridge-contracts/**'
- name: Set .env
if: steps.filter.outputs.solidity == 'true'
working-directory: ethereum-bridge-contracts
run: cp env.template .env
- name: Run Slither
uses: crytic/slither-action@v0.3.0
if: steps.filter.outputs.solidity == 'true'
id: slither
with:
fail-on: all
sarif: results.sarif
slither-config: ethereum-bridge-contracts/slither.config.json
target: ethereum-bridge-contracts
slither-args: --checklist --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/
- name: Push SARIF to DefectDojo
if: steps.filter.outputs.solidity == 'true'
# TODO: push to DefectDojo
run: ls results.sarif
- name: Create/update checklist as PR comment
uses: actions/github-script@v6
if: github.event_name == 'push' && steps.filter.outputs.solidity == 'true'
env:
REPORT: ${{ steps.slither.outputs.stdout }}
with:
script: |
const script = require('.github/scripts/comment')
const header = '# Slither report'
const { REPORT } = process.env
await script({ github, context, header, body: REPORT })