-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflows using Cypress Cloud fail in fork #693
Comments
|
|
Unfortunately I overlooked that Configuration variables are available in public beta only. I will modify my suggestion to use Action secrets instead and leave a migration to Configuration variables open for a future enhancement. |
|
|
Where to find the issue
Describe the issue
If Actions are enabled in a fork, then pushing to the
master
branch of a fork of https://github.com/cypress-io/github-action owned by a community member causes action errors from:The following errors are shown:
Steps to reproduce
User does not have edit access to repository https://github.com/cypress-io workflows (see GitHub help Accessing your secrets).
upstream
points to https://github.com/cypress-io/github-action,origin
points to forkmaster
branch onorigin
https://github.com/<fork-owner>/github-action/actions/workflows/example-custom-ci-build-id.yml?query=branch%3Amaster
https://github.com/<fork-owner>/github-action/actions/workflows/example-recording.yml?query=branch%3Amaster
Expectation
The workflows example-custom-ci-build-id and example-recording should not report additional workflow failures caused by pushing to
master
in a fork for external contributors who are not members of the https://github.com/cypress-io/ organization, compared to a Member pushing to https://github.com/cypress-io/github-action/tree/master.Workaround
Disable the workflows:
in the fork to prevent failures. See GitHub help: Disabling and enabling a workflow.
Analysis
The following two workflows show the error "You passed the --record flag but did not provide us your Record Key."
A Fork owner has no access to
secrets.EXAMPLE_RECORDING_KEY
of the public Cypress Cloud project 3tb7jn.The
projectId
is hardcoded into the corresponding Cypress config file e.g.github-action/examples/v9/recording/cypress.json
Line 5 in 78da0ec
Alternative suggestions
Skip recording in fork
Skip running the recording workflow in a fork by adding the following:
See GitHub documentation Example: Only run job for specific repository
This could be applied to the two affected workflows.
Skip recording if secrets not defined
If
secrets.EXAMPLE_RECORDING_KEY
is not defined, then the recording workflows could be skipped.Allow use of alternate Cypress Cloud project
Add
secrets.EXAMPLE_PROJECT_ID
to both affected workflows and set the environment variableCYPRESS_PROJECT_ID
using this secret (see Project ID). The environment variable overrides any Project ID stored in the Cypress configuration file.Add README documentation how to use this.
The text was updated successfully, but these errors were encountered: