Skip to content

tools: add message on auto-fixing js lint issues in gh workflow #59128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
27 changes: 26 additions & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,32 @@ 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 make lint-js-fix > /dev/null 2>&1; then
echo ' Run:'
echo ' make lint-js-fix'
echo ' to fix the lint issues.'
git diff
elif git diff --quiet --exit-code; then
echo ' None of the issue is auto-fixable, so manual fixed 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 however 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
Expand Down