Skip to content

Passing env vars to command used in 'start:' #1390

@davetapley

Description

@davetapley

Building on #85 ....

From the docs both approaches (env: host=api... and CYPRESS_host: api...) imply those are setting env vars for Cypress itself, not to the command given in start:? My testing certainly seems to indicate this is the case.

In my case I want to pass a REACT_APP_ variable in to npm start.


I tried simply prefixing the start: command, e.g.:

        with:
          start: 'REACT_APP_LEGACY_API="${{matrix.legacy}}" npm start'

but that fails with:

Error: Unable to locate executable file: REACT_APP_LEGACY_API="true". Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

I also tried various quotings, but get the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions