-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow recording in fork with secrets
By defining their own EXAMPLE_PROJECT_ID and EXAMPLE_RECORD_KEY as GitHub environment variables, users can successfully run the recording examples example-custom-ci-build-id is moved from using v9 to v10
- Loading branch information
1 parent
51594fd
commit 08ab74a
Showing
4 changed files
with
101 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# example: recording | ||
|
||
The recording example uses [Cypress Cloud](https://docs.cypress.io/guides/cloud/introduction) to record results using the Cypress Cloud `projectId` as defined in the [cypress.config.js](cypress.config.js) configuration file. | ||
|
||
## Using your own Cypress Cloud project | ||
|
||
In order to use the recording example with your own Cypress Cloud project, you need to replace the `projectId` and `record key` with your own values. | ||
|
||
Follow the [Cypress Cloud](https://docs.cypress.io/guides/cloud/introduction) documentation to sign up, if you do not already have an account, or to [sign in](https://cloud.cypress.io/) if you have an account. | ||
|
||
Create a new project if one does not exist. | ||
|
||
Access "Project settings" in Cypress Cloud and copy the contents of each of the following parameters for the project into the Security settings of your GitHub fork, using "Secrets and variables" > "Actions", then "Variables" for the "Project ID" and "Secrets" for the "Record Key" as in the table below: | ||
|
||
| Cypress Cloud name | Actions name in fork | Variable type | | ||
| ------------------ | -------------------- | ----------------- | | ||
| Project ID | EXAMPLE_PROJECT_ID | Actions variables | | ||
| Record Keys | EXAMPLE_RECORD_KEY | Actions secrets | | ||
|
||
Refer to the GitHub documentation | ||
- [Defining configuration variables for multiple workflows](https://docs.github.com/en/actions/learn-github-actions/variables#defining-configuration-variables-for-multiple-workflows) | ||
- [Creating encrypted secrets for a repository](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository). | ||
|
||
When you have done this, the example recording will take the `projectId` from the `EXAMPLE_PROJECT_ID` variable instead of from the [cypress.config.js](cypress.config.js) configuration file. | ||
|
||
This setup allows the example recording to run in your own Cypress Cloud project, whilst leaving the same example for use in the parent repository [cypress-io/github-action](https://github.com/cypress-io/github-action) unchanged. The parent repository has its own `EXAMPLE_RECORD_KEY` defined as a secret and it uses the `projectId` as defined in the [cypress.config.js](cypress.config.js) configuration file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# example: recording | ||
|
||
The recording example uses [Cypress Cloud](https://docs.cypress.io/guides/cloud/introduction) to record results using the Cypress Cloud `projectId` as defined in the [cypress.json](cypress.json) configuration file. | ||
|
||
## Using your own Cypress Cloud project | ||
|
||
In order to use the recording example with your own Cypress Cloud project, you need to replace the `projectId` and `record key` with your own values. | ||
|
||
Follow the [Cypress Cloud](https://docs.cypress.io/guides/cloud/introduction) documentation to sign up, if you do not already have an account, or to [sign in](https://cloud.cypress.io/) if you have an account. | ||
|
||
Create a new project if one does not exist. | ||
|
||
Access "Project settings" in Cypress Cloud and copy the contents of each of the following parameters for the project into the Security settings of your GitHub fork, using "Secrets and variables" > "Actions", then "Variables" for the "Project ID" and "Secrets" for the "Record Key" as in the table below: | ||
|
||
| Cypress Cloud name | Actions name in fork | Variable type | | ||
| ------------------ | -------------------- | ----------------- | | ||
| Project ID | EXAMPLE_PROJECT_ID | Actions variables | | ||
| Record Keys | EXAMPLE_RECORD_KEY | Actions secrets | | ||
|
||
Refer to the GitHub documentation | ||
- [Defining configuration variables for multiple workflows](https://docs.github.com/en/actions/learn-github-actions/variables#defining-configuration-variables-for-multiple-workflows) | ||
- [Creating encrypted secrets for a repository](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository). | ||
|
||
When you have done this, the example recording will take the `projectId` from the `EXAMPLE_PROJECT_ID` variable instead of from the [cypress.json](cypress.json) configuration file. | ||
|
||
This setup allows the example recording to run in your own Cypress Cloud project, whilst leaving the same example for use in the parent repository [cypress-io/github-action](https://github.com/cypress-io/github-action) unchanged. The parent repository has its own `EXAMPLE_RECORD_KEY` defined as a secret and it uses the `projectId` as defined in the [cypress.json](cypress.json) configuration file. |