Commit message missing from Cypress Cloud when cypress/included container is used in GitHub Actions
verheyenkoen opened this issue · comments
Description
When we let Cypress tests run on the container cypress/included, commit message is no longer logged in Cypress Cloud. The commit hash is still there but no link to click.
URL of Issue(s)
https://cloud.cypress.io/projects/fm8w1c/runs/71/overview
Steps to replicate
- Add these last two lines to your workflow yaml file for a recorded run as described here:
jobs:
cypress-run:
runs-on: ubuntu-22.04
container:
image: cypress/included
- Commit and push to GitHub
- Rerun the workflow on GitHub Actions
- Commit message is missing from Cypress Cloud
When you remove these again, the necessary information reappears.
Browser
n/a
Device
- PC
- Mac
- iPhone
- iPad
- Android Phone
- Android Tablet
Additional Information
GITHUB token is provided as an ENV variable, like so: https://github.com/ugent-library/deliver/blob/fa660f2f7eb801315311c00de37263d6cf53aacf/.github/workflows/cypress-tests.yml#L35
Thanks for reporting the issue that the commit message is missing in Cypress Cloud if you are using a Cypress Docker container like this:
jobs:
cypress-run:
runs-on: ubuntu-22.04
container:
image: cypress/included
It seems that this is a permissions issue, as I am able to reproduce the situation:
- no commit MESSAGE shown on Cypress Cloud
- Numerical COMMIT is shown on Cypress Cloud, however it is not a hyperlink back to the GitHub repo
After adding the Docker user 1001
, as below, the commit MESSAGE was shown and the COMMIT was a hyperlink.
jobs:
cypress-run:
runs-on: ubuntu-latest
container:
image: cypress/included:latest
options: --user 1001
Would you like to try this?
I also have some other comments on your workflow. Let's get the main point sorted out first if possible though.
Yes, this worked, thanks!
Hey @MikeMcC399 , having the same issue. Workflow:
jobs:
cypress:
runs-on: default-visable
container:
image: cypress/browsers:node18.12.0-chrome107
options: --user 1001
env:
GITHUB_TOKEN: ${{ secrets.PACKAGES_READ_ONLY_TOKEN_GITHUB }}
PUBLIC_API_URL: "https://api.staging.visable.io"
IS_CYPRESS: "true"
BASE_URL: "https://www.wlw-staging.de"
REQUESTS_INTERNAL_API: "https://requests-service.internal.wlw-1.staging.visable.cloud/requests_service/internal_api"
RECAPTCHA_SITE_KEY: "6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"
RECAPTCHA_SECRET_KEY: "6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe"
steps:
- uses: pnpm/action-setup@v3
with:
version: 8.15.3
- name: Define proper Checkout REF
shell: bash
run: echo "ref=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF}})" >> $GITHUB_OUTPUT
id: extract_ref
- uses: actions/checkout@v4
with:
ref: "${{ steps.extract_ref.outputs.ref }}"
- name: setup github packages authentication
run: 'echo "//npm.pkg.github.com/:_authToken=${{ secrets.PACKAGES_READ_ONLY_TOKEN_GITHUB }}" > ~/.npmrc'
- uses: cypress-io/github-action@v6
id: cypress
env:
GITHUB_TOKEN: ${{ secrets.PACKAGES_READ_ONLY_TOKEN_GITHUB }}
COMMIT_INFO_BRANCH: ${{ github.ref_name }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
with:
record: true
build: pnpm build
start: pnpm start
browser: chrome
- name: cleanup repo files
if: always()
run: find . -mindepth 1 -delete
Please open a new issue. The previous one was about cypress/included
which you are not using.
It may be a permissions issue again, since you are apparently using a self-hosted runner.
Yes, it seems it is a permissions issue indeed.
#1175 done