generated from reviewdog/action-composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.sh
executable file
·35 lines (30 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
#!/bin/sh
set -e
TYPOS_VERSION=v1.24.5
if [ -n "${GITHUB_WORKSPACE}" ]; then
cd "${GITHUB_WORKSPACE}/${INPUT_WORKDIR}" || exit
fi
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"
echo '::group::🐶 Installing typos ... https://github.com/crate-ci/typos'
TEMP_PATH="$(mktemp -d)"
PATH="${TEMP_PATH}:$PATH"
wget -O - -q https://raw.githubusercontent.com/crate-ci/gh-install/057430d007bc58dc624003c9af8ff9cf1f747c66/v1/install.sh |
sh -s -- --tag "${TYPOS_VERSION}" --git crate-ci/typos --target x86_64-unknown-linux-musl --to "${TEMP_PATH}"
echo '::endgroup::'
echo '::group:: Running typos with reviewdog 🐶 ...'
# shellcheck disable=SC2086
typos ${INPUT_TYPOS_FLAGS} --format json |
jq -f "${GITHUB_ACTION_PATH}/to-rdjsonl.jq" -c |
reviewdog \
-f="rdjsonl" \
-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}" \
-tee \
${INPUT_REVIEWDOG_FLAGS}
exit_code=$?
echo '::endgroup::'
exit $exit_code