diff --git a/action.yml b/action.yml index f3d6ea3..75a2bb7 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,8 @@ inputs: description: 'The path to the Slither configuration file. By default, `./slither.config.json` is used if present.' slither-version: description: 'The version of slither-analyzer to use. By default, the latest release in PyPI is used.' + slither-plugins: + description: 'A requirements.txt file to install alongside Slither. Useful to install custom plugins.' ignore-compile: description: 'Whether to ignore the compilation step when running crytic-compile and Slither.' default: false diff --git a/entrypoint.sh b/entrypoint.sh index a839ea5..5c3ca6c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,6 +21,7 @@ SARIFOUT="$4" SLITHERVER="$5" SLITHERARGS="$(get INPUT_SLITHER-ARGS)" SLITHERCONF="$(get INPUT_SLITHER-CONFIG)" +SLITHERPLUGINS="$(get INPUT_SLITHER-PLUGINS)" STDOUTFILE="/tmp/slither-stdout" IGNORECOMPILE="$(get INPUT_IGNORE-COMPILE)" @@ -185,6 +186,13 @@ install_slither() export PATH="/opt/slither/bin:$PATH" pip3 install wheel pip3 install "$SLITHERPKG" + + if [[ -n "$SLITHERPLUGINS" ]]; then + echo "[-] Slither plugins provided, installing them" + pushd "$(dirname "$SLITHERPLUGINS")" >/dev/null + pip3 install -r "$(basename "$SLITHERPLUGINS")" + popd >/dev/null + fi } install_deps()