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:
- "Could not find Cypress test run results"
- "You passed the --record flag but did not provide us your Record Key."
Steps to reproduce
User does not have edit access to repository https://github.com/cypress-io workflows (see GitHub help Accessing your secrets).
- Create a fork of https://github.com/cypress-io/github-action
- Clone the fork to local system
upstream points to https://github.com/cypress-io/github-action, origin points to fork
- push to
master branch on origin
- View action logs and note failures:
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.
Alternative suggestions
Skip recording in fork
Skip running the recording workflow in a fork by adding the following:
if: github.repository == 'cypress-io/github-action'
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 variable CYPRESS_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.
Where to find the issue
Describe the issue
If Actions are enabled in a fork, then pushing to the
masterbranch 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).
upstreampoints to https://github.com/cypress-io/github-action,originpoints to forkmasterbranch onoriginhttps://github.com/<fork-owner>/github-action/actions/workflows/example-custom-ci-build-id.yml?query=branch%3Amasterhttps://github.com/<fork-owner>/github-action/actions/workflows/example-recording.yml?query=branch%3AmasterExpectation
The workflows example-custom-ci-build-id and example-recording should not report additional workflow failures caused by pushing to
masterin 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_KEYof the public Cypress Cloud project 3tb7jn.The
projectIdis 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_KEYis not defined, then the recording workflows could be skipped.Allow use of alternate Cypress Cloud project
Add
secrets.EXAMPLE_PROJECT_IDto both affected workflows and set the environment variableCYPRESS_PROJECT_IDusing 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.