Circleci buld should fail if css_lint returns errors

51 Views Asked by At

I have a rails application with CircleCI setup. I am using a gem called css_lint which returns the list of errors if the commit contains any CSS file error. Errors are returned but the build does not fail. I am also using set -e in the beginning. Below is my code. Please suggest how to fail my build in case of errors.

  - run:
      name: Run css_lint
      command: |
        set -e
        git diff -z --name-only --diff-filter=d origin/master...HEAD | grep -z -Z '.css$' | xargs -r -0 css_lint --errors=box-sizing,display-property-grouping,duplicate-properties,empty-rules,errors,known-properties
0

There are 0 best solutions below