github-action: `dashboardUrl` not set in step outputs?

I just enabled recording on Cypress dashboard for my project, but am having trouble printing the dashboardUrl.

It prints at the end of a run (in the Cypress step itself), but when I try to print it in another step it’s blank

Cypress step:

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  smoke.test.ts                            00:14        3        3        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:14        3        3        -        -        -  


───────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                       
  Recorded Run: https://dashboard.cypress.io/projects/xxx/runs/7           

Print step:

Cypress finished with: success
See results at

My configuration

name: Deploy
on:
  pull_request:
    types: [assigned, opened, synchronize, reopened]

jobs:
  build-deploy:
    ...
  smoke-test:
    needs: build-deploy
    runs-on: ubuntu-latest
    name: Smoke test
    timeout-minutes: 5
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Cypress run
        uses: cypress-io/github-action@v2
        id: cypress
        continue-on-error: true
        with:
          command-prefix: yarn dlx # need this bc using yarn pnp w/o node_modules
          install-command: yarn install --immutable --immutable-cache
          build: yarn build-custom
          headless: true
          config: baseUrl=https://env.com/
          spec: cypress/integration/smoke.test.ts
          record: true
        env:
          CYPRESS_PROJECT_ID: xxx
          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Print Dashboard URL
        run: |
          echo Cypress finished with: ${{ steps.cypress.outcome }}
          echo See results at ${{ steps.cypress.outputs.dashboardUrl }}

Update: I also tried echo ${{ toJSON(steps.cypress.outputs) }} in my step and it just prints an empty object {}

Update 2: added missing configuration for command-prefix and custom install

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 28 (4 by maintainers)

Most upvoted comments

@jazanne this may be a bug. We’ll have to look into it a bit more.

@MikeMcC399 yep the issue i’m seeing seems in line with the new docs you added https://github.com/cypress-io/github-action/pull/846 - url not set using custom command.

thanks for looking into this

Would still love to see this changed/supported in the future.

I’m guessing that this would need to be an enhancement to Cypress in order to expose / export the Cypress Cloud URL.

  • I have made a suggestion to update the README documentation in PR #846.
  • Whilst the pull request is still in review mode you can read the suggestion under the link Outputs.

@Erenndriel

I don’t think that it’d be the right direction to assume that --record is meant for Cypress when passed to command input.

You are right. It would not be possible to catch all cases, so it is not a good candidate at all for an enhancement request. Thanks again for your inputs and insight!

Appreciate your reply @MikeMcC399 !

I wholeheartedly agree with you that there are gaps in that regard and that a PR to improve such docs would be a time saver for many others who’d stumble upon this inconsistent behavior. That being said, the custom command can actually be any other command in package.json , say a custom NodeJS script that runs numerous process, one of them being cypress itself. With that in consideration, how can one consider --record flag is the flag for cypress or for another thing that the developers intended to?

E.g.:

  • In my package.json assume I have myScript: "node scripts/generateFromTemplate.js" .
  • Assume I will run this from my CLI: npm run myScript --record.
  • The --record is parsed from the script and applied something completely different, not related to cypresss ---record flag.
  • If we were to grab (grep) the --record flag from the command: npm run myScript --record, we are to assume/believe that the developer intended to set Cypress’ --record flag, which in this **case ** is not.

I don’t think that it’d be the right direction to assume that --record is meant for Cypress when passed to command input.

@far11ven

You can also try this out for yourself if you have a fork of this repository. Follow the instructions in