Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass value for command-prefix the output resultsUrl doesn't get set #1377

Closed
fwyattblake opened this issue Feb 27, 2025 · 4 comments · Fixed by #1378
Closed

Pass value for command-prefix the output resultsUrl doesn't get set #1377

fwyattblake opened this issue Feb 27, 2025 · 4 comments · Fixed by #1378
Assignees
Labels
Cypress Cloud documentation Improvements or additions to documentation released

Comments

@fwyattblake
Copy link

When I set the input parameter: command-prefix the output resultsUrl is not set

example

- name: Cypress run
        id: cypress
        uses: cypress-io/github-action@v6
        with:
          record: true
          command-prefix: 'percy exec -- npx'
          spec: ${{ inputs.specPattern }}
          config:  baseUrl=${{inputs.baseUrl}}
          env: percy=true,degug=${{ inputs.debug }},testName=${{ inputs.testName }}
          tag: ${{ inputs.testName }}
        env:
          CYPRESS_RECORD_KEY: ${{ inputs.cypress_record_key }}
          CYPRESS_PROJECT_ID: ${{ inputs.cypress_project_id }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PERCY_TOKEN: ${{ inputs.percy_token }}

      - name: Print Cypress Cloud URL
        if: always()
        run: |
          echo See results at ${{ steps.cypress.outputs.resultsUrl }}

output

Recorded Run: https://cloud.cypress.io/projects/XXXXXX/runs/87 

[percy] Finalized build #22: https://percy.io/xxxxx/web/xxxxxxxx-73b3439a/builds/38645566'
[percy] Build's CLI and CI logs sent successfully. Please share this log ID with Percy team in case of any issues - 38645566_build_xxxxxxx

resultURL is blank.

If I remove the command-prefix, the results will be set.

@fwyattblake
Copy link
Author

I just saw this in the documentation: https://github.com/cypress-io/github-action?tab=readme-ov-file#outputs

This action sets a GitHub step output resultsUrl if the run was recorded on [Cypress Cloud](https://on.cypress.io/cloud-introduction) using the action parameter setting record: true (see [Record test results on Cypress Cloud](https://github.com/cypress-io/github-action?tab=readme-ov-file#record-test-results-on-cypress-cloud)). Note that using a [Custom test command](https://github.com/cypress-io/github-action?tab=readme-ov-file#custom-test-command) with the command parameter overrides the record parameter and in this case no resultsUrl step output is saved.

So this isn't a bug

@MikeMcC399 MikeMcC399 added the documentation Improvements or additions to documentation label Feb 28, 2025
@MikeMcC399
Copy link
Collaborator

@fwyattblake

This is an undocumented restriction of using the command-prefix option. It's similar to the one for the command option which you pointed out.

resultsUrl is only returned when Cypress is run using the Cypress Module API which is by-passed when command-prefix is used.

The Percy Cypress documentation specifies using the command line to run Percy and Cypress. This does not allow running Cypress using the Cypress Module API and therefore resultsUrl is not available:

npx percy exec -- cypress run

This restriction should be added to the Outputs documentation.

@MikeMcC399
Copy link
Collaborator

Copy link

🎉 This issue has been resolved in version 6.7.14 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cypress Cloud documentation Improvements or additions to documentation released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants