question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exit Code and Status

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
ozumcommented, 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.

0reactions
BraveLilToastercommented, Jun 10, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 6. Exit and Exit Status
Every command returns an exit status (sometimes referred to as a return status or exit code). A successful command returns a 0, while...
Read more >
Bash command line exit codes demystified | Enable Sysadmin
An exit code is a system response that reports success, an error, or another condition that provides a clue about what caused an...
Read more >
Exit status - Wikipedia
The exit status of a process in computer programming is a small number passed from a child process (or callee) to a parent...
Read more >
Bash get exit code of command on a Linux / Unix - nixCraft
Every Linux or Unix command executed by the shell script or user has an exit status. Exit status is an integer number. 0...
Read more >
Standard Exit Status Codes in Linux - Baeldung
In Linux, when a process is terminated, it returns an exit code. Upon successful execution, this code is equal to zero. Any non-zero...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found