-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor CI workflow and update Slither analysis
- Loading branch information
Showing
1 changed file
with
13 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,31 +123,28 @@ jobs: | |
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
slither_analysis: | ||
needs: setup | ||
analyze: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Cache node modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
**/node_modules | ||
key: ${{ needs.setup.outputs.cache-key }} | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run Slither | ||
uses: crytic/[email protected] | ||
id: slither | ||
with: | ||
slither-version: "0.10.0" | ||
node-version: "18" | ||
fail-on: "none" | ||
slither-args: '--filter-paths "contracts/mock|node_modules" --checklist --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/contracts/' | ||
|
||
- name: Create/update checklist as PR comment | ||
uses: actions/[email protected] | ||
uses: actions/github-script@v7 | ||
env: | ||
REPORT: ${{ steps.slither.outputs.stdout }} | ||
with: | ||
script: | | ||
const script = require('.github/scripts/comment'); | ||
const header = '# Slither report'; | ||
const body = `${{ env.REPORT }}`; // Use template literal to assign REPORT env var to body | ||
await script({ github, context, header, body }); | ||
env: | ||
REPORT: ${{ steps.slither_analysis.outputs.stdout }} | ||
const script = require('.github/scripts/comment') | ||
const header = '# Slither report' | ||
const body = process.env.REPORT | ||
await script({ github, context, header, body }) |