ataylorme / eslint-annotate-action

A GitHub action that takes ESLint results from a JSON file and adds them as annotated pull request comments
MIT License
93 stars 33 forks source link

Doesn't report on warnings #80

Open vldslv-a opened 4 months ago

vldslv-a commented 4 months ago

Hello! I've run into the following problem: it doesn't report eslint warnings My config:

  - name: Annotate Code Linting Results
    uses: ataylorme/eslint-annotate-action@v3
    with:
      GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
      report-json: reports/eslint_report.json
      only-pr-files: true
      fail-on-warning: true
      fail-on-error: true
      markdown-report-on-step-summary: true

As a result, I receive the following message:

image

But I don't see annotation about it in the PR. Could you fix it? This works well with errors, but not with warnings.

beanow-at-crabnebula commented 4 months ago

Likewise, if there are both errors and warnings, the errors get reported in the summary but the warnings do not.

Mentioning:

Pull Request Changed Files ESLint Results:

1 ESLint error(s) and 0 ESLint warning(s) found

While this should actually be 1 error, 1 warning for my test case.

beanow-at-crabnebula commented 4 months ago

Disregard my comment. The text actually gave the hint here. "Pull Request Changed Files".

Somewhere between v1.5.1 and v2.0.0 the behavior seems to have changed to only include errors/warning from code that was changed in that PR.

Maybe you were (also) expecting warnings from code that wasn't change in that PR?

vldslv-a commented 4 months ago

Maybe you were (also) expecting warnings from code that wasn't change in that PR?

No, the problem is in the modified file. A little above, I use tj-actions/changed-files@v42 to get the changed files and run the linter only for them With only-pr-files: true, I had problems that it took into account ALL files, not just the modified ones. But that's a different issue, I think)