From 56e1411d37b0a613277d546bf13897e0c4de7fc0 Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Sun, 25 Sep 2022 19:56:15 +0100 Subject: [PATCH] ci(e2e): fix e2e action when running from fork PRs from forks don't have acess to the secrets.CYPRESS_RECORD_KEY. Because of this, we need to disable `recording`. --- .github/workflows/e2e.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 194f870542..3a7f767d8a 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -37,11 +37,16 @@ jobs: # and run all Cypress tests - name: Cypress run uses: cypress-io/github-action@v3 + # If CYPRESS_RECORD_KEY is set, run in parallel on all containers + # Otherwise (e.g. if running from fork), we run on a single container only + if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }} with: start: yarn dev wait-on: 'http://localhost:9000' - record: true + # Disable recording if we don't have an API key + # e.g. if this action was run from a fork + record: ${{ secrets.CYPRESS_RECORD_KEY != '' }} + parallel: ${{ secrets.CYPRESS_RECORD_KEY != '' }} headless: true - parallel: true env: CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}