Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] fail_on_error: false still fails the job #2049

Closed
4 tasks done
jkasztur opened this issue Sep 12, 2024 · 1 comment
Closed
4 tasks done

[BUG] fail_on_error: false still fails the job #2049

jkasztur opened this issue Sep 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jkasztur
Copy link

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
@jkasztur jkasztur added the bug Something isn't working label Sep 12, 2024
@jackton1
Copy link
Member

jackton1 commented Sep 24, 2024

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

@jackton1 jackton1 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants