Skip to content

Commit 9c8d8ea

Browse files
committed
fix eslint test in github action runner
1 parent fe61db4 commit 9c8d8ea

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/nodejs.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,21 @@ 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+
git status;
36+
git checkout HEAD -- package.json;
37+
changes=$(git diff --name-only origin/HEAD --no-renames --diff-filter=ACMR);
3438
if [ "$changes" == "" ]; then
3539
echo "checking all files";
3640
node node_modules/eslint/bin/eslint "lib/ace/**/*.js";
3741
else
38-
changes=$(echo "$changes" | grep -P '.js$');
39-
echo "checking $changes";
40-
if [ "$changes" != "" ]; then
41-
node node_modules/eslint/bin/eslint $changes;
42+
jsChanges=$(echo "$changes" | grep -P '.js$' || :);
43+
if [ "$jsChanges" == "" ]; then
44+
echo "nothing to check";
45+
else
46+
echo "checking $jsChanges";
47+
node node_modules/eslint/bin/eslint $jsChanges;
4248
fi
4349
fi
4450
# - run: npm run lint

0 commit comments

Comments
 (0)