-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscript.sh
executable file
·38 lines (32 loc) · 1.08 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
#!/bin/sh -e
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"
TEMP_PATH="$(mktemp -d)"
PATH="${TEMP_PATH}:$PATH"
echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog'
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b "${TEMP_PATH}" 2>&1
echo '::endgroup::'
if [ "${INPUT_USE_BUNDLER}" = "true" ]; then
echo '::group:: Installing erb-lint via bundler'
bundle install
echo '::endgroup::'
fi
if [ "${INPUT_USE_BUNDLER}" = "false" ]; then
BUNDLE_EXEC=""
else
BUNDLE_EXEC="bundle exec "
fi
if [ -z "${INPUT_CONFIG_FILE}" ]; then
CONFIG_FILE="--config=.erb-lint.yml"
else
CONFIG_FILE="--config=${INPUT_CONFIG_FILE}"
fi
echo '::group:: Running erb-lint with reviewdog 🐶 ...'
${BUNDLE_EXEC}erblint --lint-all --format compact ${CONFIG_FILE} \
| reviewdog \
-efm="%f:%l:%c: %m" \
-reporter="${INPUT_REPORTER}" \
-filter-mode="${INPUT_FILTER_MODE}" \
-level="${INPUT_LEVEL}" \
-fail-level="${INPUT_FAIL_LEVEL}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}"
echo '::endgroup::'