Skip to content

Commit fe23b21

Browse files
committed
fix
1 parent b5293f0 commit fe23b21

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.github/workflows/linter.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
name: ESLint & Prettier
2-
32
on:
43
pull_request:
54
branches: [master]
6-
75
jobs:
86
lint:
97
name: Lint and format-check changed JS files
10-
118
runs-on: ubuntu-latest
12-
139
steps:
1410
- name: Checkout code
1511
uses: actions/checkout@v4
@@ -23,11 +19,13 @@ jobs:
2319
node-version: 20.x
2420
cache: "npm"
2521

22+
- name: Install dependencies
23+
run: npm ci
24+
2625
- name: Get changed JavaScript files
2726
id: get_files
2827
run: |
2928
git diff --diff-filter=ACMRT --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- '*.js' '*.mjs' ':!node_modules/**' > changed-js-files.txt
30-
3129
if [ -s changed-js-files.txt ]; then
3230
echo "has_files=true" >> "$GITHUB_OUTPUT"
3331
else
@@ -40,10 +38,10 @@ jobs:
4038
echo "Linting the following files:"
4139
cat changed-js-files.txt
4240
xargs -r npx eslint < changed-js-files.txt
41+
4342
- name: Run Prettier check on changed files
4443
if: steps.get_files.outputs.has_files == 'true'
4544
run: |
4645
echo "Checking formatting for the following files:"
4746
cat changed-js-files.txt
48-
xargs -r npx prettier --check < changed-js-files.txt
49-
47+
xargs -r npx prettier --check < changed-js-files.txt

0 commit comments

Comments
 (0)