Skip to content

Github actions: Conditionally record test results to cypress.io while using on: deployment_status trigger #21321

Discussion options

You must be logged in to vote

You have to have some scripting logic before the Cypress runstep, which gives you a boolean result. After that, you pass that result instead of record: true

name: e2e-ci
on: deployment_status

jobs:
  e2e:
    if: github.event.deployment_status.state == 'success'
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      # Install NPM dependencies, cache them correctly
      # and run all Cypress tests
      
      # some CI logic that gives you a result, assigned to a variavble named thatResult
      
      
      - name: Cypress run
        uses: cypress-io/github-action@v2
        with:
          record: $(thatResult)
        env:
          CYPR…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bscaspar
Comment options

Answer selected by bscaspar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants