From efe532f75be7cad318a0a5a5044dc8e6a1e91d2c Mon Sep 17 00:00:00 2001 From: burnettk Date: Fri, 19 May 2023 11:33:56 -0400 Subject: [PATCH] record if the workflow run that triggered us was a push --- .github/workflows/frontend_tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/frontend_tests.yml b/.github/workflows/frontend_tests.yml index abcce006..4998fe8b 100644 --- a/.github/workflows/frontend_tests.yml +++ b/.github/workflows/frontend_tests.yml @@ -104,7 +104,11 @@ jobs: # only record on push, not pull_request, since we do not have secrets for PRs, # so the required CYPRESS_RECORD_KEY will not be available. # we have limited runs in cypress cloud, so only record main builds - record: ${{ github.ref_name == 'main' && github.event_name == 'push' }} + # the direct check for github.event_name == 'push' is for if we want to go back to triggering this workflow + # directly, rather than when Backend Tests complete. + # note that github.event.workflow_run is referring to the Backend Tests workflow and another option + # for github.event.workflow_run.event is 'pull_request', which we want to ignore. + record: ${{ github.ref_name == 'main' && ((github.event_name == 'workflow_run' && github.event.workflow_run.event == 'push') || (github.event_name == 'push')) }} env: # pass the Dashboard record key as an environment variable CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}