-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathentrypoint.sh
executable file
·40 lines (33 loc) · 1.14 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
#!/bin/sh
if [ "${RUNNER_DEBUG}" = "1" ] ; then
set -x
fi
if [ -n "${GITHUB_WORKSPACE}" ] ; then
cd "${GITHUB_WORKSPACE}" || exit
git config --global --add safe.directory "${GITHUB_WORKSPACE}" || exit 1
fi
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"
# shellcheck disable=SC2086
actionlint -oneline ${INPUT_ACTIONLINT_FLAGS} | while read -r r; do
shellcheck_output=" shellcheck reported issue in this script: "
severity=e
# Parse the severity if the output is from shellcheck
if echo "${r}" | grep "${shellcheck_output}"; then
s="$(echo "${r}" | sed -e "s/^.*${shellcheck_output}[^:]*:\([^:]\).*$/\1/g")"
if [ "${s}" = 'e' ] || [ "${s}" = 'w' ] || [ "${s}" = 'i' ] || [ "${s}" = 'n' ]; then
severity="${s}"
fi
fi
echo "${severity}:${r}"
done \
| reviewdog \
-efm="%t:%f:%l:%c: %m" \
-name="${INPUT_TOOL_NAME}" \
-reporter="${INPUT_REPORTER}" \
-filter-mode="${INPUT_FILTER_MODE}" \
-fail-level="${INPUT_FAIL_LEVEL}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS}
exit_code=$?
exit $exit_code