-
Notifications
You must be signed in to change notification settings - Fork 4
43 lines (34 loc) · 990 Bytes
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Lint
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install asdf version manager to reuse the versions declared in .tool-versions
- name: Install asdf and tools
uses: asdf-vm/actions/install@v3
- name: Install Dependencies
run: npm install
- name: Lint
run: npx eslint
- name: Diff
if: ${{ failure() }}
run: |
npx eslint --fix
git diff HEAD > eslint-fixes.patch
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: eslint fixes
path: eslint-fixes.patch
- name: Write to job summary
if: ${{ failure() }}
run: |
echo '```diff' >> $GITHUB_STEP_SUMMARY
cat eslint-fixes.patch >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY