From a162164631ecf1d883f360479f5d8d608b2b523f Mon Sep 17 00:00:00 2001 From: yshrsmz Date: Fri, 20 Jan 2023 21:06:37 +0900 Subject: [PATCH] use `npx --offline` to support npm v9 --- script.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script.sh b/script.sh index 9fa32b1..84cdc29 100755 --- a/script.sh +++ b/script.sh @@ -11,16 +11,17 @@ echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/review curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b "${TEMP_PATH}" "${REVIEWDOG_VERSION}" 2>&1 echo '::endgroup::' -if [ ! -f "$(npm bin)/eslint" ]; then +npx --offline eslint --version +if [ $? -ne 0 ]; then echo '::group:: Running `npm install` to install eslint ...' npm install echo '::endgroup::' fi -echo "eslint version:$($(npm bin)/eslint --version)" +echo "eslint version:$(npx --offline eslint --version)" echo '::group:: Running eslint with reviewdog 🐶 ...' -$(npm bin)/eslint -f="${ESLINT_FORMATTER}" ${INPUT_ESLINT_FLAGS:-'.'} \ +npx --offline eslint -f="${ESLINT_FORMATTER}" ${INPUT_ESLINT_FLAGS:-'.'} \ | reviewdog -f=rdjson \ -name="${INPUT_TOOL_NAME}" \ -reporter="${INPUT_REPORTER:-github-pr-review}" \