From 7dcd048e37a157757f4b2334a235a68a509c2dba Mon Sep 17 00:00:00 2001 From: 0xmad <0xmad@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:27:35 -0600 Subject: [PATCH] chore: add slither github action --- .github/workflows/slither.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/slither.yml diff --git a/.github/workflows/slither.yml b/.github/workflows/slither.yml new file mode 100644 index 0000000000..5b5a12d4f5 --- /dev/null +++ b/.github/workflows/slither.yml @@ -0,0 +1,49 @@ +name: Slither Analysis + +on: + push: + branches: [dev] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + slither: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: latest + + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + + - name: Install + run: | + pnpm install --frozen-lockfile --prefer-offline + + - name: Build + run: | + pnpm run build + + - name: Run Slither + uses: crytic/slither-action@v0.3.0 + continue-on-error: true + id: slither + with: + sarif: results.sarif + fail-on: none + ignore-compile: true + node-version: 20 + target: "contracts/" + + - name: Upload SARIF file + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: ${{ steps.slither.outputs.sarif }}