Skip to content

chore: prevent GitHub Actions recording examples running in fork - #1185

Open
MikeMcC399 wants to merge 3 commits into
cypress-io:masterfrom
MikeMcC399:gha-examples-block-in-fork
Open

chore: prevent GitHub Actions recording examples running in fork#1185
MikeMcC399 wants to merge 3 commits into
cypress-io:masterfrom
MikeMcC399:gha-examples-block-in-fork

Conversation

@MikeMcC399

@MikeMcC399 MikeMcC399 commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Issue

The set of example CI workflows includes three GitHub Actions workflows that record to Cypress Cloud using a projectId owned by Cypress.io with a secret Record Key.

These workflows fail if they are executed unchanged in a user fork of the parent repo. The fork has no access to the necessary Record Key.

Workflow file Workflow name
.github/workflows/parallel.yml Cypress parallel tests
.github/workflows/single.yml Cypress single tests
.github/workflows/using-action.yml Using Cypress GH Action

Change

  • Prevent the above workflows running in a fork. Only run if: github.repository_owner == 'cypress-io'.

  • The exception is the single-run job of .github/workflows/using-action.yml which does not record, and so does not fail if a matching Record Key is missing. This job is not blocked from running.

Verification

Attempt to manually run each of the above workflows in a fork, and confirm that they are skipped without error.


Note

Low Risk
CI-only guard conditions with no application, auth, or data-path changes; risk is limited to workflow skip behavior in forks versus the parent repo.

Overview
Forks of this repo were failing CI because example workflows record to Cypress Cloud using a Record Key secret that only exists on the parent cypress-io repository.

This PR adds if: github.repository_owner == 'cypress-io' to jobs that record to Cypress Cloud: the install job in parallel.yml, the test job in single.yml, and the parallel-runs and parallel-runs-across-platforms jobs in using-action.yml. Comments note that forks need their own project ID and Record Key to run those examples.

The single-run job in using-action.yml is intentionally unchanged (no if) because it does not record, so it can still run in forks. That workflow also gets clearer job names and documentation; a stale top-of-file comment about pinning cypress-io/github-action versions was removed.

Reviewed by Cursor Bugbot for commit c3732c2. Bugbot is set up for automated code reviews on this repo. Configure here.

@cypress-app-bot

Copy link
Copy Markdown
Collaborator

@MikeMcC399
MikeMcC399 marked this pull request as ready for review August 15, 2026 11:15
@MikeMcC399 MikeMcC399 self-assigned this Aug 15, 2026
@MikeMcC399
MikeMcC399 requested a review from mschile August 17, 2026 05:11
Block running in a fork because the necessary
Record Key is not accessible.
@MikeMcC399
MikeMcC399 force-pushed the gha-examples-block-in-fork branch from 828f641 to 566bbbb Compare August 21, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GHA recording workflows fail in fork on push event

3 participants