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
Copy file name to clipboardExpand all lines: README.md
+18-12Lines changed: 18 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ The following examples demonstrate the actions' functions.
57
57
-[`wait-on` with Node.js 18+](#wait-on-with-nodejs-18) workarounds
58
58
- Use [custom install command](#custom-install-command)
59
59
- Use [command prefix](#command-prefix)
60
-
- Use [own custom test command](#custom-test-command)
60
+
- Use [custom test command](#custom-test-command)
61
61
- Pass [custom build id](#custom-build-id) when recording to Cypress Cloud
62
62
- Generate a [robust custom build id](#robust-custom-build-id) to allow re-running the workflow
63
63
- Use different [working-directory](#working-directory)
@@ -964,22 +964,28 @@ jobs:
964
964
965
965
### Custom test command
966
966
967
-
You can overwrite the Cypress run command with your own command.
967
+
The `command` parameter executes a CLI command using the GitHub [@actions/exec](https://github.com/actions/toolkit/tree/main/packages/exec) action.
968
+
969
+
This parameter is useful for special test cases, for example:
970
+
971
+
- in the project [examples/custom-command](./examples/custom-command/), a JavaScript [examples/custom-command/index.js](./examples/custom-command/index.js) is run with `node .` through `command: npm run custom-test`
972
+
- in the workflow [example-yarn-modern-pnp.yml](.github/workflows/example-yarn-modern-pnp.yml) Yarn Modern with Plug'n'Play is run with `command: yarn run --binaries-only cypress run` since [Yarn Plug'n'Play](#yarn-plugnplay) is not natively supported by the action.
973
+
974
+
If you don't have a special case and you just need to convert a `cypress run` CLI command to use the Cypress GitHub Action, refer to the section [Migrating from CLI command](#migrating-from-cli-command) which explains how to map CLI options to equivalent action parameters, avoiding the need for the `command` parameter in most cases.
975
+
976
+
There are some parameters that cannot be used together with the `command` parameter, and these are ignored. The parameters include action input parameters listed in the table [CLI Run Option / Action Parameter](#cli-run-option--action-parameter), the [publish-summary](#suppress-job-summary), [summary-title](#job-summary-title) and [command-prefix](#command-prefix). If any such parameters are passed to the action, a warning message appears in the logs that the parameters have been ignored.
977
+
978
+
Correct Example:
968
979
969
980
```yml
970
981
steps:
971
-
- name: Checkout 🛎
972
-
uses: actions/checkout@v4
973
-
974
-
- name: Custom tests 🧪
975
-
uses: cypress-io/github-action@v6
982
+
- uses: actions/checkout@v4
983
+
- uses: cypress-io/github-action@v6
976
984
with:
977
-
command: npm run e2e:ci
985
+
command: npm run custom-test
978
986
```
979
987
980
-
**Caution**: using the action parameter `command` causes multiple other parameters to be ignored including: `auto-cancel-after-failures`, `browser`, `ci-build-id`, `command-prefix`, `component`, `config`, `config-file`, `env`, `group`, `headed`, `parallel`, `project`, `publish-summary`, `quiet`, `record`, `spec` and `tag`.
981
-
982
-
See [example-custom-command.yml](.github/workflows/example-custom-command.yml) file.
@@ -1607,7 +1613,7 @@ If you configure a `workflow_dispatch` event in your own workflows, you will be
1607
1613
1608
1614
### Outputs
1609
1615
1610
-
This action sets a GitHub step output `resultsUrl` if the run was recorded on [Cypress Cloud](https://on.cypress.io/cloud-introduction) using the action parameter setting `record: true` (see [Record test results on Cypress Cloud](#record-test-results-on-cypress-cloud)). Note that if a custom test command with the [command](#custom-test-command) option or the [command-prefix](#command-prefix) option are used then no `resultsUrl` step output is saved.
1616
+
This action sets a GitHub step output `resultsUrl` if the run was recorded on [Cypress Cloud](https://on.cypress.io/cloud-introduction) using the action parameter setting `record: true` (see [Record test results on Cypress Cloud](#record-test-results-on-cypress-cloud)). Note that if a custom test command with the [command](#custom-test-command) parameter or the [command-prefix](#command-prefix) parameter are used then no `resultsUrl` step output is saved.
1611
1617
1612
1618
This is an example of using the step output `resultsUrl`:
0 commit comments