Skip to content

Commit

Permalink
ci(slither): run only on solidity files changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-N-Chernyshov committed Oct 13, 2023
1 parent faa7a1c commit 236b661
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/slither.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@ jobs:
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
Expand All @@ -22,12 +30,15 @@ jobs:
slither-args: --checklist --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/

- name: Push SARIF to DefectDojo
if: (success() || failure()) && steps.filter.outputs.solidity == 'true'
# TODO: push to DefectDojo
run: ls results.sarif
# run: ls results.sarif
# run: echo ${{ steps.slither.outputs.stdout }}
run: echo ${{ steps.slither.outputs.stderr }}

- name: Create/update checklist as PR comment
uses: actions/github-script@v6
if: github.event_name == 'push'
if: (success() || failure()) && github.event_name == 'push' && steps.filter.outputs.solidity == 'true'
env:
REPORT: ${{ steps.slither.outputs.stdout }}
with:
Expand Down

0 comments on commit 236b661

Please sign in to comment.