Skip to content

Commit

Permalink
tool working. SARIF 1st attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
mcp-coinbase committed Sep 18, 2024
1 parent e8625fd commit c6cf9f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions .github/actions/slither-action/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,20 @@ URLPREFIX="https://github.com/"
PROJECTURL="$URLPREFIX$GITHUB_REPOSITORY/"


###### TESTING #####
echo "PROJECTSCOPE is $PROJECTSCOPE"
echo "CONTRACTSPWD is $CONTRACTSPWD"
echo "PROJECTURL is $PROJECTURL"
echo "cat /tmp/scope.txt"
###### Echo the parameters passed to the tool for debugging #####
echo "################ START DEBUGGING INFORMATION ################"
echo "Contracts' PWD is '$CONTRACTSPWD'"
echo "Project Type is '$PROJECTSCOPE'. ('src' = Foundry | 'contracts' = Hardhat)"
echo "Project URL is '$PROJECTURL'"
echo "Contents of our scope.txt file:"
cat /tmp/scope.txt
###### TESTING #####
echo "################ END DEBUGGING INFORMATION ################"


################## Run the tool ##################
# trap "output_stdout" EXIT # Set a trap to call the output_stdout function when the script exits
cd $TOOLPWD # Move to 4naly3er folder (required to run it)
yarn analyze $CONTRACTSPWD /tmp/scope.txt $PROJECTURL # Finally, run the tool
echo "4naly3er analysis completed." # Results in report.md and report.sarif.json
cp report.md report.sarif.json /tmp/ # Copy results to /tmp/ for SARIF ingestion
exit 0 # Exit success
4 changes: 2 additions & 2 deletions .github/workflows/slither.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
uses: ./.github/actions/slither-action
id: slither
with:
sarif: results.sarif
sarif: /tmp/report.sarif.json
fail-on: none

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
sarif_file: /tmp/report.sarif.json


# Set GH_TOKEN permissions to be as restricted as possible
Expand Down

0 comments on commit c6cf9f5

Please sign in to comment.