forked from sscpac/statick-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·60 lines (46 loc) · 1.15 KB
/
entrypoint.sh
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
59
60
#!/usr/bin/env bash
mkdir -p /tmp/statick_output
STATICK_ARGS=""
if [ -n "$INPUT_PACKAGE_PATH" ]; then
STATICK_ARGS+=" $INPUT_PACKAGE_PATH"
else
echo "Package not supplied, but is required."
exit 1
fi
if [ -n "$INPUT_CHECK" ]; then
if [ "$INPUT_CHECK" = "true" ]; then
STATICK_ARGS+=" --check"
fi
fi
if [ -n "$INPUT_CONFIG" ]; then
STATICK_ARGS+=" --config $INPUT_CONFIG"
fi
if [ -n "$INPUT_LEVEL" ]; then
STATICK_ARGS+=" --level $INPUT_LEVEL"
fi
if [ -n "$INPUT_LOG_LEVEL" ]; then
STATICK_ARGS+=" --log $INPUT_LOG_LEVEL"
fi
if [ -n "$INPUT_OUTPUT_PATH" ]; then
STATICK_ARGS+=" --output-directory $INPUT_OUTPUT_PATH"
fi
if [ -n "$INPUT_PROFILE" ]; then
STATICK_ARGS+=" --profile $INPUT_PROFILE"
fi
if [ -n "$INPUT_TIMINGS" ]; then
if [ "$INPUT_TIMINGS" = "true" ]; then
STATICK_ARGS+=" --timings"
fi
fi
if [ -n "$INPUT_USER_PATHS" ]; then
STATICK_ARGS+=" --user-paths $INPUT_USER_PATHS"
fi
# shellcheck disable=SC1091
. /opt/venv/bin/activate
# shellcheck disable=SC2086
statick $STATICK_ARGS
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Error(s) found by Statick, or Statick did not run successfully"
exit $exit_code
fi