feat: add expose input for Cypress.expose() API#1749
Conversation
Adds a new `expose` input that maps to the Cypress `--expose` CLI flag and `cypressOptions.expose` Module API option, introduced in Cypress 15.10.0. This complements the existing `env` input as Cypress.env() is deprecated and being replaced by Cypress.expose() (for non-sensitive, public config) and cy.env() (for sensitive values). Closes #1744
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 453d6a8. Configure here.
This comment was marked as resolved.
This comment was marked as resolved.
|
Thanks @MikeMcC399! Added a CHANGELOG.md entry in 275f527 — used |
|
Thanks @MikeMcC399! Added |
There was a problem hiding this comment.
LGTM!
Thanks for picking up the issue I submitted and implementing this enhancement.
I guess that the examples/env will need to be visited before migrating to Cypress 16 when the time comes. At the moment it's handling non-secret values, so possibly it could be simplified and most of its contents could be moved over to the expose example.
This comment was marked as resolved.
This comment was marked as resolved.
…an-c76d21 # Conflicts: # CHANGELOG.md
|
🎉 This PR is included in version 7.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |

Closes #1744
Summary
exposeaction input that maps to Cypress's--exposeCLI flag (andcypressOptions.exposein Module API mode), supporting the newCypress.expose()API introduced in Cypress 15.10.0.examples/expose/example project, anexample-expose.ymlworkflow, and README documentation matching the structure of the existingenvinput.Why
Cypress.env()was deprecated in Cypress 15.10.0 (removal in 16.0.0). Its functionality is being split into two replacement APIs:Cypress.expose()— synchronous, browser-accessible, for non-sensitive public config valuescy.env()— asynchronous, Node-side, for sensitive valuesThis action previously had no way to pass values to the new
exposeoption, so users wanting to migrate away fromCypress.env()were blocked.Changes
action.yml— newexposeinputindex.js— pass--exposein CLI mode, setcypressOptions.exposein Module API mode, and addexposetocommandIgnoredStringInputsexamples/expose/— minimal example with a spec assertingCypress.expose()access.github/workflows/example-expose.yml— runs the new example on push/PRREADME.md— TOC entry, new### Exposesection with usage example and badge, and--expose/-xrow in the CLI option mapping tabledist/index.js— rebuiltTest plan
example-exposeworkflow passes on this PRcheck-distpasses (verifiesdist/index.jsis in sync)🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because it changes how the action builds Cypress CLI/module options by introducing a new
--expose/cypressOptions.exposepath, which could affect command construction and option parsing; remaining changes are docs/examples and a rebuiltdist/index.js.Overview
Adds a new action input
exposeand wires it through to Cypress as--exposein CLI mode andcypressOptions.exposein Module API mode (also treating it as ignored whencommandis used).Updates docs/changelog to describe the new parameter and CLI mapping, and adds a runnable
examples/exposeproject plus a newexample-exposeworkflow to validateCypress.expose()behavior;dist/index.jsis rebuilt accordingly.Reviewed by Cursor Bugbot for commit 7ff74c5. Bugbot is set up for automated code reviews on this repo. Configure here.