Skip to content

Commit

Permalink
Always output stdout, even on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
elopez committed Apr 19, 2024
1 parent 1a35558 commit 46fbdf4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ install_deps()
fi
}

output_stdout()
{
DELIMITER="$(random_string)"
{ echo "stdout<<$DELIMITER"; cat "$STDOUTFILE"; echo -e "\n$DELIMITER"; } >> "$GITHUB_OUTPUT"
}

compatibility_link
install_slither

Expand Down Expand Up @@ -276,12 +282,11 @@ fi

FAILONFLAG="$(fail_on_flags)"

trap "output_stdout" EXIT

if [[ -z "$SLITHERARGS" ]]; then
slither "$TARGET" $SARIFFLAG $IGNORECOMPILEFLAG $FAILONFLAG $CONFIGFLAG | tee "$STDOUTFILE"
else
echo "[-] SLITHERARGS provided. Running slither with extra arguments"
printf "%s\n" "$SLITHERARGS" | xargs slither "$TARGET" $SARIFFLAG $IGNORECOMPILEFLAG $FAILONFLAG $CONFIGFLAG | tee "$STDOUTFILE"
fi

DELIMITER="$(random_string)"
{ echo "stdout<<$DELIMITER"; cat "$STDOUTFILE"; echo -e "\n$DELIMITER"; } >> "$GITHUB_OUTPUT"

0 comments on commit 46fbdf4

Please sign in to comment.