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

Exit Code and Status #50

Closed
ozum opened this issue May 14, 2020 · 5 comments
Closed

Exit Code and Status #50

ozum opened this issue May 14, 2020 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@ozum
Copy link

ozum commented May 14, 2020

Most probably, I'm missing something, but ESLint and Prettier does not stop workflow and have green checkmark even with errors.

As a result code with lint errors get published.

This is my config:

      - name: Run linters
        uses: samuelmeuli/lint-action@v1
        with:
          github_token: ${{ secrets.github_token }}
          eslint: true
          eslint_extensions: js,jsx,ts,tsx,vue
          eslint_args: --max-warnings 0
          prettier: true
          prettier_extensions: json,less,css,md,gql,graphql,html,yaml
          prettier_args: --ignore-path .eslintignore

image

By the way, this workflow is for push event.

@samuelmeuli
Copy link
Collaborator

The action should have created two additional checks for you, named ESLint and Prettier. Details here: #31

@samuelmeuli samuelmeuli added the duplicate This issue or pull request already exists label May 16, 2020
@ozum
Copy link
Author

ozum commented May 16, 2020

@samuelmeuli thanks for the answer. How can I combine results of ESLint and Prettier and conditionally run Release step?

Currently I have a workflow similar to below. (Simplified for example purposes)

  - name: Run linters
    uses: samuelmeuli/lint-action@v1
    with:
      eslint: true
      prettier: true
  - name: Test
    run: jest
  - name: Release
    if: [SHOULD I ADD SOME CONDITION BASED ON PRETTIER AND ESLINT RESULT ???]
    run: npm publish

PS: This is push workflow, not PR

Edit2: I just wanted to prevent release on push, if lint or test fails.

@BraveLilToaster
Copy link

Normally I would use needs (see docs) in the workflow, but I am having issues with this as well. Since the checks ESLint and Prettier aren't declared in the workflow I can't use needs here.

 - name: Run linters
    uses: samuelmeuli/lint-action@v1
    with:
      eslint: true
      prettier: true
  - name: Test
    run: jest
  - name: Release
    needs: [Prettier, ESLint]
    run: npm publish

@ozum
Copy link
Author

ozum commented Jun 10, 2020

@samuelmeuli could you please elaborate?

@BraveLilToaster
Copy link

I looked through the source code and realized that the ESLint and Prettier checks that are created here are actual github Checks. I have no idea if these can be depended on to prevent a job like "Release" from being run.

@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
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants