File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ inputs:
21
21
description : ' Whether to ignore the compilation step when running crytic-compile and Slither.'
22
22
default : false
23
23
type : boolean
24
+ internal-github-workspace :
25
+ # Do not set manually. This is a hacky way to pass the host workspace path to inside the action
26
+ # This is used to improve compatibility when using `ignore-compile`.
27
+ # GitHub rewrites the argument if it is passed directly, so we use toJSON to "transform"
28
+ # it and avoid the remapping done by GitHub Actions.
29
+ default : ${{ toJSON(github.workspace) }}
24
30
outputs :
25
31
sarif :
26
32
description : ' If produced, the path of the SARIF file, relative to the repo root.'
Original file line number Diff line number Diff line change @@ -15,6 +15,16 @@ SLITHERARGS="$(get INPUT_SLITHER-ARGS)"
15
15
SLITHERCONF=" $( get INPUT_SLITHER-CONFIG) "
16
16
IGNORECOMPILE=" $( get INPUT_IGNORE-COMPILE) "
17
17
18
+ compatibility_link ()
19
+ {
20
+ HOST_GITHUB_WORKSPACE=" $( get INPUT_INTERNAL-GITHUB-WORKSPACE | tr -d \" ) "
21
+ if [[ -d " $GITHUB_WORKSPACE " ]]; then
22
+ mkdir -p " $( dirname " $HOST_GITHUB_WORKSPACE " ) "
23
+ ln -s " $GITHUB_WORKSPACE " " $HOST_GITHUB_WORKSPACE "
24
+ echo " [-] Applied compatibility link: $HOST_GITHUB_WORKSPACE -> $GITHUB_WORKSPACE "
25
+ fi
26
+ }
27
+
18
28
install_solc ()
19
29
{
20
30
if [[ -z " $SOLCVER " ]]; then
@@ -153,6 +163,7 @@ if [[ -z "$IGNORECOMPILE" || $IGNORECOMPILE =~ ^[Ff]alse$ ]]; then
153
163
install_foundry
154
164
install_deps
155
165
else
166
+ compatibility_link
156
167
IGNORECOMPILEFLAG=" --ignore-compile"
157
168
fi
158
169
You can’t perform that action at this time.
0 commit comments