github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Warnings from the build step causes the action to fail even though CI is set to false

Open Yusuf-YENICERI opened this issue 4 years ago • 3 comments

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 avatar Dec 16 '21 22:12 Yusuf-YENICERI

@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

Alexa-Green avatar Jan 25 '22 22:01 Alexa-Green

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 avatar Jan 27 '22 12:01 Yusuf-YENICERI

@Yusuf-YENICERI Thank you!

Alexa-Green avatar Feb 05 '22 22:02 Alexa-Green

Closing, since the submitter wrote that the problem is resolved.

MikeMcC399 avatar Nov 05 '23 11:11 MikeMcC399