mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
tools: add message on auto-fixing js lint issues in gh workflow
PR-URL: https://github.com/nodejs/node/pull/59128 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
26
.github/workflows/linters.yml
vendored
26
.github/workflows/linters.yml
vendored
@@ -103,7 +103,31 @@ jobs:
|
||||
- name: Environment Information
|
||||
run: npx envinfo
|
||||
- name: Lint JavaScript files
|
||||
run: NODE=$(command -v node) make lint-js
|
||||
run: |
|
||||
set +e
|
||||
NODE=$(command -v node) make lint-js
|
||||
EXIT_CODE="$?"
|
||||
if [ "$EXIT_CODE" != "0" ]; then
|
||||
echo
|
||||
echo 'ERROR: The JavaScript lint validation failed (the errors are logged above).'
|
||||
echo ' Please fix the lint errors.'
|
||||
if NODE=$(command -v node) make lint-js-fix > /dev/null 2>&1; then
|
||||
echo ' Run:'
|
||||
echo ' make lint-js-fix'
|
||||
echo ' to fix the lint issues.'
|
||||
git --no-pager diff
|
||||
elif git diff --quiet --exit-code; then
|
||||
echo ' None of the issue is auto-fixable, so manual fixes for'
|
||||
echo ' all of the issues are required.'
|
||||
else
|
||||
echo ' Run:'
|
||||
echo ' make lint-js-fix'
|
||||
echo ' to fix the auto-fixable lint issues.'
|
||||
echo ' Note that some manual fixes are also required.'
|
||||
fi
|
||||
echo
|
||||
exit "$EXIT_CODE"
|
||||
fi
|
||||
- name: Get release version numbers
|
||||
if: ${{ github.event.pull_request && github.event.pull_request.base.ref == github.event.pull_request.base.repo.default_branch }}
|
||||
id: get-released-versions
|
||||
|
||||
Reference in New Issue
Block a user