You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example directory examples/env uses the Cypress.env() API call to get environment variables in tests. These are non-secret environment variables. The related workflow example-env.yml refers to this usage in comments.
Follow developments in Cypress and migrate usage of Cypress.env() as appropriate, and at an appropriate time, to avoid demonstrating any deprecated API usage and instead demonstrate handling environment variables according to updated recommendations.
Migrating the examples in this repo to use new API functions that are only available in Cypress >=15.10.0 would mean that the examples would no longer be compatible with earlier Cypress versions. Effectively the use of new API functions from Cypress >= 15.10.0 would be a breaking change in this repo.
I suggest to delay any related updates here until Cypress 16 is available.
There is no simple migration path for these examples, so they either need to be removed or replaced with something which demonstrates cy.env() in a GitHub Actions environment. Possibly also some of the details from the env example needs to be integrated into the expose example.
This probably needs a decision from the Cypress.io team.
I found a solution by retaining the current env example and skipping its execution in Cypress >=15.10.0. This is proposed in PR test: restrict example/env to Cypress <15.10 #1888 and merging this will allow upgrading all examples to Cypress 16.
Activity
MikeMcC399 commentedon Feb 10, 2026
Migrating away from Cypress.env() has been published
MikeMcC399 commentedon Feb 10, 2026
MikeMcC399 commentedon Feb 11, 2026
Migrating the examples in this repo to use new API functions that are only available in Cypress >=15.10.0 would mean that the examples would no longer be compatible with earlier Cypress versions. Effectively the use of new API functions from Cypress >= 15.10.0 would be a breaking change in this repo.
I suggest to delay any related updates here until Cypress 16 is available.
The new API can be demonstrated in https://github.com/cypress-io/cypress-example-kitchensink, where GitHub Actions examples workflows are also available.
MikeMcC399 commentedon Apr 28, 2026
exposeparameter #1744 is relatedMikeMcC399 commentedon Sep 3, 2026
cypress@16.0.0, released on Sep 1, 2026, removes
Cypress.env()and the Migration Guide links toCypress.env()removed.The recommended replacement is:
cy.env()for sensitive configuration informationCypress.expose()for non-sensitive configuration informationCypress.expose()is already demonstrated through examples/expose and .github/workflows/example-expose.yml. This also shows the usage of the action'sexposeparameter.The Cypress Module API option
envcorresponding to the action parameterenvis now specified for use with secret environment variables.Cypress.env()usage must be removed or replaced to allow upgrade of the repo to Cypress 16.examples/env uses the Cypress.env() however it demonstrates the use of non-sensitive environment variables.
cy.env()has very different usage toCypress.expose(). It is not possible to simply replaceCypress.expose()withcy.env(). That will fail.MikeMcC399 commentedon Sep 3, 2026
@jennifer-shehane
The presence of the current state of the
envexamples blocks upgrading to Cypress 16:There is no simple migration path for these examples, so they either need to be removed or replaced with something which demonstrates
cy.env()in a GitHub Actions environment. Possibly also some of the details from theenvexample needs to be integrated into theexposeexample.This probably needs a decision from the Cypress.io team.
MikeMcC399 commentedon Sep 5, 2026
envexample and skipping its execution in Cypress >=15.10.0. This is proposed in PR test: restrict example/env to Cypress <15.10 #1888 and merging this will allow upgrading all examples to Cypress 16.MikeMcC399 commentedon Sep 9, 2026
Cypress.env()as a blocker to upgrading to Cypress 16.envexample could be copied to theexposeexample for completeness.