File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 11name : ESLint & Prettier
2-
32on :
43 pull_request :
54 branches : [master]
6-
75jobs :
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
You can’t perform that action at this time.
0 commit comments