Skip to content

Commit

Permalink
ci: add gh slither action
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-N-Chernyshov committed Oct 13, 2023
1 parent 94eec2a commit ad532ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = async ({ github, context, header, body }) => {
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
issue_number: context.issue.number,
});

const botComment = comments.find(
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/slither.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@ jobs:
id: slither
with:
fail-on: none
continue-on-error: true
sarif: results.sarif
slither-config: ethereum-bridge-contracts/slither.config.json
target: ethereum-bridge-contracts
slither-args: --checklist --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/

- name: ls
run: ls
- name: Push SARIF to DefectDojo
# TODO: push to DefectDojo
# run: ls results.sarif
run: echo ${{ github.event.number }}

- name: Create/update checklist as PR comment
uses: actions/github-script@v6
if: github.event_name == 'push'
env:
REPORT: ${{ steps.slither.outputs.stdout }}
with:
script: |
const script = require('.github/scripts/comment')
const header = '# Slither report'
# const body = `${{ steps.slither.outputs.stdout }}`
# await script({ github, context, header, body })
const { REPORT } = process.env
const { PR_NUMBER } = process.env
await script({ github, context, header, body: REPORT })

0 comments on commit ad532ac

Please sign in to comment.