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

"Run linters" check passes despite linting errors #31

Closed
DirtDiglett opened this issue Mar 25, 2020 · 2 comments
Closed

"Run linters" check passes despite linting errors #31

DirtDiglett opened this issue Mar 25, 2020 · 2 comments
Labels
question Further information is requested

Comments

@DirtDiglett
Copy link

Hi, I'm trying to use a workflow with a lint job and a build job. The build job is set to need the lint to complete successfully to begin so that I don't waste time building if linting returned issues. When linting though, that step is marked successfully completed even if the linters found issues. Is this expected behaviour? Shouldn't the step be marked fail if the linter returns issues?

firefox_8CXddMBi8n

name: STAGING - Lint and Build

on:
  push:
    branches-ignore:
      - master
jobs:
  Lint:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: "Setup Node.js"
        uses: actions/setup-node@v1
        with:
          node-version: 12.x
      
      - name: "Install Node Packages"
        run: npm ci

      - name: "Lint - Sass & Javascript"
        uses: samuelmeuli/lint-action@v1.3.0
        with:
          github_token: ${{ secrets.github_token }}
          eslint: true
          stylelint: true

  Build:
    runs-on: ubuntu-latest
    needs: Lint # Only run the build if linting suceeded.

    steps:
      - name: Test
        run: ls -la
@samuelmeuli
Copy link
Collaborator

That's the expected behavior. That's why the build step is called "Run linters" in the example workflow. IMO it would be confusing if two checks would fail because of one linting error. Users might also go look at the "Run linters" step to see why it failed, which wouldn't contain the information they're looking for (the linting errors).

@samuelmeuli samuelmeuli added the question Further information is requested label Mar 28, 2020
@samuelmeuli samuelmeuli changed the title Linting returns errors but step still marked as complete successfully. "Run linters" check passes despite linting errors Mar 28, 2020
@BraveLilToaster
Copy link

That's the expected behavior. That's why the build step is called "Run linters" in the example workflow. IMO it would be confusing if two checks would fail because of one linting error. Users might also go look at the "Run linters" step to see why it failed, which wouldn't contain the information they're looking for (the linting errors).

While I see your point about not wanting to be confusing for users, it should be possible output a message to help users see that that one or more of the lint checks failed and point them to look at those checks.

I think a lot of users of this action would benefit from having a way to prevent other jobs from running if linting fails. If that is not something you want to provide in this action that is of course up to you. I know I would really appreciate if you would share your preferred method for achieving this in your own workflows.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants