tj-actions/eslint-changed-files

[BUG] fail_on_error: false still fails the job

Closed this issue · 1 comments

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

Even when I specify fail_on_error: false the job still fails when there are some eslint errors. It should pass even with errors
image

To Reproduce

name: Verify pull request build
on:
  pull_request:
    branches:
      - '*'
jobs:
  lint:
    name: Run lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '20.9.0'

      - name: Install dependencies
        run: npm ci

      - name: Run eslint on changed files
        uses: tj-actions/eslint-changed-files@v25
        with:
          config_path: .eslintrc.js
          skip_annotations: true
          fail_on_error: false

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-22.04

Expected behavior?

To pass the job, even when there are eslint errors

Relevant log output

Run tj-actions/eslint-changed-files@v25
  with:
    config_path: .eslintrc.js
    skip_annotations: true
    fail_on_error: false
    token: ***
    all_files: false
    file_extensions: **/*.{ts,tsx,js,jsx}
  
    level: error
    reporter: github-pr-review
    filter_mode: added
    path: .
    skip_initial_fetch: false
    use_rest_api: false
    escape_paths: true

Has all relevant logs been included?

  • I've included all relevant logs

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Hi @jkasztur, the fail_on_error input sets the "# Exit code for review dog when errors are found." not Eslint which runs when you set skip_annotations to true. See: https://github.com/tj-actions/eslint-changed-files/blob/main/entrypoint.sh#L41

To prevent Eslint reported errors from marking the workflow step as failed you would need to use continue-on-error

name: Verify pull request build
on:
  pull_request:
    branches:
      - '*'
jobs:
  lint:
    name: Run lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '20.9.0'

      - name: Install dependencies
        run: npm ci

      - name: Run eslint on changed files
        uses: tj-actions/eslint-changed-files@v25
        continue-on-error: true # <-- Add this line
        with:
          config_path: .eslintrc.js
          skip_annotations: true
          fail_on_error: false