-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
58 lines (53 loc) · 1.82 KB
/
Copy pathaction.yml
File metadata and controls
58 lines (53 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: 'HookGuard'
description: 'Risk scan for Uniswap v4 hooks — flags documented v4 risk patterns on every pull request.'
author: 'chaosxcode'
branding:
icon: 'shield'
color: 'orange'
inputs:
paths:
description: 'Space-separated paths to scan. Directories are searched recursively for .sol files.'
required: false
default: 'src'
fail-on:
description: 'Severity that fails the check: HIGH, MEDIUM, LOW, or never. Default HIGH — HookGuard is a heuristic, so failing a build on a MEDIUM would be overreach.'
required: false
default: 'HIGH'
comment:
description: 'Post a summary comment on the pull request, edited in place rather than duplicated. Requires pull-requests: write.'
required: false
default: 'true'
json-out:
description: 'Optional path to write machine-readable results to.'
required: false
default: ''
outputs:
high:
description: 'Number of HIGH findings.'
value: ${{ steps.hookguard.outputs.high }}
total:
description: 'Total number of findings.'
value: ${{ steps.hookguard.outputs.total }}
contracts:
description: 'Number of hook contracts analysed.'
value: ${{ steps.hookguard.outputs.contracts }}
runs:
using: 'composite'
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Run HookGuard
id: hookguard
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
HG_PATHS: ${{ inputs.paths }}
HG_FAIL_ON: ${{ inputs.fail-on }}
HG_COMMENT: ${{ inputs.comment }}
HG_JSON_OUT: ${{ inputs.json-out }}
run: |
args=($HG_PATHS --fail-on "$HG_FAIL_ON" --comment "$HG_COMMENT")
if [ -n "$HG_JSON_OUT" ]; then args+=(--json-out "$HG_JSON_OUT"); fi
python3 "${{ github.action_path }}/src/ci.py" "${args[@]}"