File tree Expand file tree Collapse file tree 1 file changed +20
-10
lines changed
Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change 6565 env :
6666 cache-name : cache-eslint
6767 with :
68- path : ~/.eslintcache
69- key : ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('.eslintrc') }}
70- restore-keys : |
71- ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('.eslintrc') }}
72- ${{ runner.os }}-${{ env.cache-name }}-
68+ path : |
69+ .eslintcache
70+ key : ${{ runner.os }}-eslint-${{ hashFiles('**/pnpm-lock.json', '**/eslint.config.js') }}
7371
7472 - name : Install
7573 run : pnpm install --frozen-lockfile --prefer-offline
@@ -92,12 +90,24 @@ jobs:
9290
9391 - name : Annotate ESLint Results
9492 if : ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
95- uses : ataylorme/eslint-annotate-action@v2
93+ uses : ataylorme/eslint-annotate-action@v3
9694 with :
97- repo-token : " ${{ secrets.GITHUB_TOKEN }}"
95+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
9896 report-json : " eslint.results.json"
99- fail-on-warning : true
97+ fail-on-warning : false
98+ fail-on-error : false
10099
101- - name : Check If ESLint Failed
100+ - name : Show ESLint Summary and Failures
102101 if : steps.eslint-continue.outcome == 'failure'
103- run : exit 1
102+ run : |
103+ ERRORS=$(cat eslint.results.json | jq '[.[] | select(.errorCount > 0)] | length')
104+ WARNINGS=$(cat eslint.results.json | jq '[.[] | select(.warningCount > 0)] | length')
105+
106+ echo "Files with errors: $ERRORS"
107+ echo "Files with warnings: $WARNINGS"
108+
109+ if [ "$ERRORS" -gt 0 ]; then
110+ echo "::error::Found linting errors in $ERRORS files"
111+ pnpm lintcached
112+ exit 1
113+ fi
You can’t perform that action at this time.
0 commit comments