Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx will print error below if no cache is available. Should we suppress the output?

$ npx --offline eslint --version >/dev/null
npm ERR! code ENOTCACHED
npm ERR! request to https://registry.npmjs.org/eslint failed: cache mode is 'only-if-cached' but no cached response is available.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/yshrsmz/.npm/_logs/2023-01-20T12_15_39_019Z-debug-0.log

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}" \
Expand Down