From 6dd152d405e48ad0e0b53f2d26d9321d6b9e60ea Mon Sep 17 00:00:00 2001 From: Alexey Chernyshov Date: Fri, 13 Oct 2023 17:30:57 +0300 Subject: [PATCH] ci(slither): run only on solidity files changed --- .github/workflows/slither.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/slither.yml b/.github/workflows/slither.yml index 2d7bc95fab..838a5cebc5 100644 --- a/.github/workflows/slither.yml +++ b/.github/workflows/slither.yml @@ -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 @@ -22,12 +30,13 @@ 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 - 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: