Warnings from the build step causes the action to fail even though CI is set to false
Here is the part of my workflow:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: CI=false
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: yarn build
start: yarn start
env:
CI: false
Here is the error produced by workflow:
"Treating warnings as errors because process.env.CI = true. Most CI servers set it automatically.
Failed to compile."
My project is producing warnings in the build step and this causes the action to fail. Because it says CI is set to true even though i have assigned it to false.
How can i set it correctly?
@Yusuf-YENICERI Did you ever figure this out? Happening for me too-- have tried also:
env:
CI: false
env:
CI: ''
- run: CI=false
- run: CI=''
with:
build: CI= yarn build
with:
build: CI='' yarn build
with:
build: CI=false yarn build
I have resolved this problem in the following workflow:
https://github.com/Yusuf-YENICERI/Hatim-Dagit/blob/main/.github/workflows/firebase-hosting-merge.yml
The reason setting CI to false is not working probably related with the cypress's own environment.
@Yusuf-YENICERI Thank you!
Closing, since the submitter wrote that the problem is resolved.