GitHub Action running npm build fails on warnings

On a new GitHub Action I’ve added on a React project, the npm run build is failing because apparently GitHib Actions treat warnings as errors:

Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.

Failed to compile.

Following advice on questions to this post, adding CI=false to the ‘npm run build’ script in package.json turns off this behavior:

    "predeploy": "CI=false && npm run build",

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.