generated from reviewdog/action-composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
script.sh
executable file
·59 lines (53 loc) · 1.62 KB
/
script.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
#!/bin/sh
set -e
SCRIPT_DIR=$(dirname "$0")
. "${SCRIPT_DIR}/lib/biome.sh"
if [ -n "${GITHUB_WORKSPACE}" ]; then
cd "${GITHUB_WORKSPACE}/${INPUT_WORKDIR}" || exit
fi
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"
echo '::group:: Running Biome with reviewdog 🐶 ...'
if [ "$INPUT_REPORTER" = "github-pr-review" ]; then
# shellcheck disable=SC2086
biome_check ${INPUT_BIOME_FLAGS} |
reviewdog \
-efm="%-G%f ci ━%#" \
-efm="%-G%f lint ━%#" \
-efm="%-Gci ━%#" \
-efm="%E%f:%l:%c %.%#" \
-efm="%E%f %.%#" \
-efm="%C" \
-efm="%C × %m" \
-efm="%C %m" \
-efm="%-G%.%#" \
-name="${INPUT_TOOL_NAME}" \
-reporter="${INPUT_REPORTER}" \
-filter-mode="${INPUT_FILTER_MODE}" \
${INPUT_FAIL_LEVEL:+-fail-level="${INPUT_FAIL_LEVEL}"} \
${INPUT_FAIL_ON_ERROR:+-fail-on-error="${INPUT_FAIL_ON_ERROR}"} \
-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS}
else
# shellcheck disable=SC2086
biome_ci ${INPUT_BIOME_FLAGS} |
reviewdog \
-efm="%-G%f ci ━%#" \
-efm="%-G%f lint ━%#" \
-efm="%-Gci ━%#" \
-efm="%E%f:%l:%c %.%#" \
-efm="%E%f %.%#" \
-efm="%C" \
-efm="%C × %m" \
-efm="%C %m" \
-efm="%-G%.%#" \
-name="${INPUT_TOOL_NAME}" \
-reporter="${INPUT_REPORTER}" \
-filter-mode="${INPUT_FILTER_MODE}" \
${INPUT_FAIL_LEVEL:+-fail-level="${INPUT_FAIL_LEVEL}"} \
${INPUT_FAIL_ON_ERROR:+-fail-on-error="${INPUT_FAIL_ON_ERROR}"} \
-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS}
fi
exit_code=$?
echo '::endgroup::'
exit $exit_code