@cypress/github-action 6.7.13 → 6.7.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # cypress-io/github-action [![Action status][ci-badge]][ci-workflow] [![cypress][cloud-badge]][cloud-project] [![renovate-app badge][renovate-badge]][renovate-bot]
2
2
 
3
- > [GitHub Action](https://docs.github.com/en/actions) for running [Cypress](https://www.cypress.io) end-to-end and component tests. Includes npm, pnpm and Yarn installation, custom caching and lots of configuration options.
3
+ > [GitHub Action](https://docs.github.com/en/actions) for running [Cypress](https://www.cypress.io) end-to-end and component tests. Includes npm, pnpm and Yarn installation, custom caching and lots of configuration options.
4
4
 
5
- Placing `use: cypress-io/github-action@v6` into a GitHub Action workflow gives you a simple way to run Cypress. The action takes the project's npm, pnpm or Yarn package manager lock file, installs dependencies and caches these dependencies for future use. It then proceeds to run Cypress end-to-end tests with the built-in Electron browser and provides a test summary after completion.
5
+ Placing `use: cypress-io/github-action@v6` into a GitHub Action workflow gives you a simple way to run Cypress. The action takes the project's npm, pnpm or Yarn package manager lock file, installs dependencies and caches these dependencies for future use. It then proceeds to run Cypress end-to-end tests with the built-in Electron browser and provides a test summary after completion.
6
6
 
7
- If you are testing against a running server like the [Cypress Kitchen Sink showcase example](https://example.cypress.io/) on https://example.cypress.io/ no other parameters are necessary. In other cases where you need to fire up a development server, you can add the [start](#start-server) parameter to the workflow. Browse through the examples to find other useful parameters.
7
+ If you are testing against a running server like the [Cypress Kitchen Sink showcase example](https://example.cypress.io/) on https://example.cypress.io/ no other parameters are necessary. In other cases where you need to fire up a development server, you can add the [start](#start-server) parameter to the workflow. Browse through the examples to find other useful parameters.
8
8
 
9
9
  ## Examples
10
10
 
@@ -452,9 +452,11 @@ Please refer to the [default GitHub environment variables](https://docs.github.c
452
452
  When recording runs to Cypress Cloud, the PR number and URL can be automatically detected if you pass `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}`
453
453
  via the workflow `env`. When set, this value enables the Action to perform additional logic that grabs the related PR number and URL (if they
454
454
  exist) and sets them in the environment variables `CYPRESS_PULL_REQUEST_ID` and `CYPRESS_PULL_REQUEST_URL`, respectively.
455
- * See Cypress' documentation on [CI Build Information](https://on.cypress.io/guides/continuous-integration/introduction#CI-Build-Information)
455
+
456
+ - See Cypress' documentation on [CI Build Information](https://on.cypress.io/guides/continuous-integration/introduction#CI-Build-Information)
456
457
 
457
458
  Example workflow using the variables:
459
+
458
460
  ```yml
459
461
  name: Example echo PR number and URL
460
462
  on: push
@@ -571,7 +573,6 @@ jobs:
571
573
  runs-on: ubuntu-24.04
572
574
  name: E2E
573
575
  steps:
574
-
575
576
  - name: Checkout
576
577
  uses: actions/checkout@v4
577
578
 
@@ -736,6 +737,7 @@ The Cypress GH Action does not spawn or create any additional containers - it on
736
737
  If you use the GitHub Actions facility for [Re-running workflows and jobs](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs), note that [Re-running failed jobs in a workflow](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs?tool=webui#re-running-failed-jobs-in-a-workflow) is not suited for use with parallel recording into Cypress Cloud. Re-running failed jobs in this situation does not simply re-run failed Cypress tests. Instead it re-runs **all** Cypress tests, load-balanced over the containers with failed jobs.
737
738
 
738
739
  To optimize runs when there are failing tests present, refer to optional [Cypress Cloud Smart Orchestration](https://docs.cypress.io/cloud/features/smart-orchestration/overview/) Premium features:
740
+
739
741
  - [Spec Prioritization](https://docs.cypress.io/cloud/features/smart-orchestration/spec-prioritization)
740
742
  - [Auto Cancellation](https://docs.cypress.io/guides/cloud/smart-orchestration/run-cancellation). See also [Specify auto cancel after failures](#specify-auto-cancel-after-failures) for details of how to set this option in a Cypress GH Action workflow.
741
743
 
@@ -796,6 +798,7 @@ jobs:
796
798
  with:
797
799
  start: npm start
798
800
  ```
801
+
799
802
  **Caution:** use the `start` parameter only to start a server, not to run Cypress, otherwise tests may be run twice. The action runs Cypress tests by default, unless the parameter `runTests` is set to `false`.
800
803
 
801
804
  **Note:** sometimes on Windows you need to run a different start command. You can use the `start-windows` parameter for this.
@@ -888,8 +891,6 @@ By default, `wait-on` will retry for 60 seconds. You can pass a custom timeout i
888
891
  wait-on-timeout: 120
889
892
  ```
890
893
 
891
-
892
-
893
894
  You can wait for multiple URLs to respond by separating urls with a comma
894
895
 
895
896
  ```yml
@@ -1064,7 +1065,7 @@ repo/
1064
1065
  package-lock.json
1065
1066
  ```
1066
1067
 
1067
- We use `working-directory: app-test` to match the above example directory structure:
1068
+ We use `working-directory: app-test` to match the above example directory structure:
1068
1069
 
1069
1070
  ```yml
1070
1071
  on: push
@@ -1429,11 +1430,11 @@ jobs:
1429
1430
 
1430
1431
  This action installs local dependencies using lock files. Ensure that exactly one type of lock file is used for each project or working-directory from the following supported package managers:
1431
1432
 
1432
- | Lock file | Package Manager | Installation command |
1433
- | ------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------- |
1434
- | `package-lock.json` | [npm](https://docs.npmjs.com/cli/v9/commands/npm-ci) | `npm ci` |
1435
- | `pnpm-lock.yaml` | [pnpm](https://pnpm.io/cli/install#--frozen-lockfile) | `pnpm install --frozen-lockfile` |
1436
- | `yarn.lock` | [Yarn Classic](https://classic.yarnpkg.com/en/docs/cli/install#toc-yarn-install-frozen-lockfile) | `yarn --frozen-lockfile` |
1433
+ | Lock file | Package Manager | Installation command |
1434
+ | ------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------- |
1435
+ | `package-lock.json` | [npm](https://docs.npmjs.com/cli/v9/commands/npm-ci) | `npm ci` |
1436
+ | `pnpm-lock.yaml` | [pnpm](https://pnpm.io/cli/install#--frozen-lockfile) | `pnpm install --frozen-lockfile` |
1437
+ | `yarn.lock` | [Yarn Classic](https://classic.yarnpkg.com/en/docs/cli/install#toc-yarn-install-frozen-lockfile) | `yarn --frozen-lockfile` |
1437
1438
 
1438
1439
  See section [Yarn Modern](#yarn-modern) for information about using Yarn version 2 and later.
1439
1440
 
@@ -1514,7 +1515,7 @@ If you configure a `workflow_dispatch` event in your own workflows, you will be
1514
1515
 
1515
1516
  ### Outputs
1516
1517
 
1517
- 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](#record-test-results-on-cypress-cloud)). Note that using a [Custom test command](#custom-test-command) with the `command` parameter overrides the `record` parameter and in this case no `resultsUrl` step output is saved.
1518
+ 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](#record-test-results-on-cypress-cloud)). Note that if a custom test command with the [command](#custom-test-command) option or the [command-prefix](#command-prefix) option are used then no `resultsUrl` step output is saved.
1518
1519
 
1519
1520
  This is an example of using the step output `resultsUrl`:
1520
1521
 
@@ -1697,6 +1698,7 @@ Please see our [Contributing Guideline](./CONTRIBUTING.md) which explains how to
1697
1698
  This project is licensed under the terms of the [MIT license][license-file].
1698
1699
 
1699
1700
  <!-- badge links follow -->
1701
+
1700
1702
  [ci-badge]: https://github.com/cypress-io/github-action/actions/workflows/main.yml/badge.svg
1701
1703
  [ci-workflow]: https://github.com/cypress-io/github-action/actions/workflows/main.yml
1702
1704
  [cloud-badge]: https://img.shields.io/endpoint?url=https://cloud.cypress.io/badge/simple/3tb7jn/master&style=flat&logo=cypress
package/action.yml CHANGED
@@ -91,7 +91,7 @@ inputs:
91
91
  description: 'Whether or not to silence any Cypress specific output from stdout'
92
92
  required: false
93
93
  component:
94
- description: "Lets the action know that Cypress is running component tests and not e2e tests"
94
+ description: 'Lets the action know that Cypress is running component tests and not e2e tests'
95
95
  required: false
96
96
  default: false
97
97
  outputs:
package/dist/index.js CHANGED
@@ -412,12 +412,20 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
412
412
  key,
413
413
  version
414
414
  };
415
- const response = yield twirpClient.CreateCacheEntry(request);
416
- if (!response.ok) {
415
+ let signedUploadUrl;
416
+ try {
417
+ const response = yield twirpClient.CreateCacheEntry(request);
418
+ if (!response.ok) {
419
+ throw new Error('Response was not ok');
420
+ }
421
+ signedUploadUrl = response.signedUploadUrl;
422
+ }
423
+ catch (error) {
424
+ core.debug(`Failed to reserve cache: ${error}`);
417
425
  throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
418
426
  }
419
427
  core.debug(`Attempting to upload cache located at: ${archivePath}`);
420
- yield cacheHttpClient.saveCache(cacheId, archivePath, response.signedUploadUrl, options);
428
+ yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options);
421
429
  const finalizeRequest = {
422
430
  key,
423
431
  version,
@@ -93180,7 +93188,7 @@ const supportsColor = {
93180
93188
  /***/ ((module) => {
93181
93189
 
93182
93190
  "use strict";
93183
- module.exports = JSON.parse('{"name":"@actions/cache","version":"4.0.1","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
93191
+ module.exports = JSON.parse('{"name":"@actions/cache","version":"4.0.2","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
93184
93192
 
93185
93193
  /***/ })
93186
93194
 
@@ -93693,6 +93701,7 @@ const I = (x) => x
93693
93701
 
93694
93702
  const detectPrNumber = async () => {
93695
93703
  const {
93704
+ GITHUB_API_URL,
93696
93705
  GITHUB_SHA,
93697
93706
  GITHUB_TOKEN,
93698
93707
  GITHUB_RUN_ID,
@@ -93718,7 +93727,8 @@ const detectPrNumber = async () => {
93718
93727
  )
93719
93728
 
93720
93729
  const client = new Octokit({
93721
- auth: GITHUB_TOKEN
93730
+ auth: GITHUB_TOKEN,
93731
+ baseUrl: GITHUB_API_URL
93722
93732
  })
93723
93733
 
93724
93734
  if (GITHUB_HEAD_REF) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress/github-action",
3
- "version": "6.7.13",
3
+ "version": "6.7.15",
4
4
  "description": "GitHub Action for running Cypress end-to-end and component tests",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -12,8 +12,11 @@
12
12
  "scripts": {
13
13
  "test": "echo \"There are no tests :(\"",
14
14
  "build": "ncc build -o dist index.js",
15
- "format": "prettier --write index.js src/ping.js",
16
- "check:markdown": "find *.md docs/*.md -print0 | xargs -0 -n1 markdown-link-check",
15
+ "format": "prettier --write index.js src/ping.js action.yml",
16
+ "format:markdown": "prettier --write \"**/*.md\"",
17
+ "format:markdown:check": "prettier --check \"**/*.md\"",
18
+ "lint": "eslint",
19
+ "check:markdown-links": "find *.md docs/*.md -print0 | xargs -0 -n1 markdown-link-check",
17
20
  "update:cypress": "./scripts/update-cypress-latest.sh",
18
21
  "prepare": "husky"
19
22
  },
@@ -32,7 +35,7 @@
32
35
  },
33
36
  "homepage": "https://github.com/cypress-io/github-action#readme",
34
37
  "dependencies": {
35
- "@actions/cache": "4.0.1",
38
+ "@actions/cache": "4.0.2",
36
39
  "@actions/core": "1.11.1",
37
40
  "@actions/exec": "1.1.1",
38
41
  "@actions/io": "1.1.3",
@@ -46,11 +49,16 @@
46
49
  "supports-color": "9.3.1"
47
50
  },
48
51
  "devDependencies": {
49
- "@types/node": "22.13.5",
52
+ "@eslint/js": "9.21.0",
53
+ "@stylistic/eslint-plugin": "4.2.0",
54
+ "@types/node": "22.13.9",
50
55
  "@vercel/ncc": "0.38.1",
56
+ "eslint": "9.21.0",
57
+ "eslint-plugin-cypress": "4.1.0",
58
+ "globals": "16.0.0",
51
59
  "husky": "9.1.7",
52
60
  "markdown-link-check": "3.13.6",
53
- "prettier": "3.5.2"
61
+ "prettier": "3.5.3"
54
62
  },
55
63
  "publishConfig": {
56
64
  "access": "public"