Skip to content

Commit 902b746

Browse files
committed
fix eslint test in github action runner
1 parent fe61db4 commit 902b746

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@ jobs:
3030
node-version: ${{ matrix.node-version }}
3131
- run: npm i && npm i eslint istanbul typescript
3232
- run: node_modules/.bin/istanbul cover lib/ace/test/all.js
33-
- run: changes=$(git diff --name-only origin/HEAD --no-renames --diff-filter=ACMR);
33+
- run: |
34+
set -x;
35+
changes=$(git diff --name-only origin/HEAD --no-renames --diff-filter=ACMR);
3436
if [ "$changes" == "" ]; then
3537
echo "checking all files";
3638
node node_modules/eslint/bin/eslint "lib/ace/**/*.js";
3739
else
38-
changes=$(echo "$changes" | grep -P '.js$');
39-
echo "checking $changes";
40-
if [ "$changes" != "" ]; then
41-
node node_modules/eslint/bin/eslint $changes;
40+
jsChanges=$(echo "$changes" | grep -P '.js$' || :);
41+
if [ "$jsChanges" == "" ]; then
42+
echo "nothing to check";
43+
else
44+
echo "checking $jsChanges";
45+
node node_modules/eslint/bin/eslint $jsChanges;
4246
fi
4347
fi
4448
# - run: npm run lint

0 commit comments

Comments
 (0)