|
1 | 1 | name: "ESLint Runner" |
2 | 2 | description: "Runs ESLint on the codebase" |
3 | 3 |
|
4 | | -# TODO: Eslint report fix |
5 | | - |
6 | 4 | inputs: |
7 | 5 | package_manager: |
8 | 6 | description: 'The package manager to use for running scripts. Options are "npm" or "bun".' |
9 | 7 | default: "npm" |
10 | 8 | required: false |
11 | | - GITHUB_TOKEN: |
12 | | - description: "The GitHub token to use for annotating code linting results." |
13 | | - required: true |
| 9 | + github_token: |
| 10 | + description: "The GitHub token to use for reporting lint results." |
| 11 | + required: false |
14 | 12 |
|
15 | 13 | runs: |
16 | 14 | using: "composite" |
17 | 15 | steps: |
18 | | - - name: Run tests (bun) |
| 16 | + - name: Run ESLint (bun) |
19 | 17 | if: inputs.package_manager == 'bun' |
20 | 18 | shell: bash |
21 | | - run: bunx eslint . --cache --output-file eslint_report.json --format json |
| 19 | + run: bunx eslint . --cache --cache-location .eslintcache --output-file eslint_report.json --format json |
22 | 20 |
|
23 | | - - name: Run tests (npm) |
| 21 | + - name: Run ESLint (npm) |
24 | 22 | if: inputs.package_manager == 'npm' |
25 | 23 | shell: bash |
26 | | - run: npx eslint . --cache --output-file eslint_report.json --format json |
| 24 | + run: npx eslint . --cache --cache-location .eslintcache --output-file eslint_report.json --format json |
| 25 | + |
| 26 | + - name: Transform ESLint Report |
| 27 | + if: always() |
| 28 | + uses: MeilCli/common-lint-reporter/transformer/eslint@v1 |
| 29 | + with: |
| 30 | + report_files: "eslint_report.json" |
| 31 | + github_token: ${{ inputs.github_token }} |
27 | 32 |
|
28 | | - - name: Annotate Code Linting Results |
| 33 | + - name: Report Lint Results |
29 | 34 | if: always() |
30 | | - continue-on-error: true |
31 | | - uses: ataylorme/eslint-annotate-action@v3 |
| 35 | + uses: MeilCli/common-lint-reporter@v1 |
32 | 36 | with: |
33 | | - GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} |
34 | | - report-json: "eslint_report.json" |
| 37 | + report_type: "check_run" |
| 38 | + report_to_same_check_run: "true" |
| 39 | + github_token: ${{ inputs.github_token }} |
0 commit comments