@cypress/github-action 7.4.3 → 7.4.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress/github-action",
3
- "version": "7.4.3",
3
+ "version": "7.4.4",
4
4
  "description": "GitHub Action for running Cypress end-to-end and component tests",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -47,7 +47,7 @@
47
47
  "argument-vector": "1.0.2",
48
48
  "debug": "4.4.3",
49
49
  "find-yarn-workspace-root": "2.0.0",
50
- "got": "11.8.6",
50
+ "got": "16.0.0",
51
51
  "hasha": "5.2.2",
52
52
  "quote": "0.4.0",
53
53
  "supports-color": "9.3.1"
@@ -57,9 +57,9 @@
57
57
  "@stylistic/eslint-plugin": "5.10.0",
58
58
  "@types/node": "25.9.4",
59
59
  "@vercel/ncc": "0.45.0",
60
- "eslint": "10.8.0",
61
- "eslint-plugin-cypress": "6.4.3",
62
- "globals": "17.9.0",
60
+ "eslint": "10.9.1",
61
+ "eslint-plugin-cypress": "7.0.1",
62
+ "globals": "17.11.0",
63
63
  "husky": "9.1.7",
64
64
  "markdown-link-check": "3.15.0",
65
65
  "prettier": "3.9.6"
package/src/ping-cli.js CHANGED
@@ -10,3 +10,10 @@ if (!url) {
10
10
  process.exit(1)
11
11
  }
12
12
  ping(url, timeoutSeconds * 1000)
13
+ .then(() => {
14
+ console.log('%s is responding', url)
15
+ })
16
+ .catch((err) => {
17
+ console.error('Could not connect to %s: %s', url, err.message)
18
+ process.exit(1)
19
+ })
package/src/ping.js CHANGED
@@ -1,4 +1,3 @@
1
- const got = require('got')
2
1
  const debug = require('debug')('@cypress/github-action')
3
2
 
4
3
  /**
@@ -6,11 +5,14 @@ const debug = require('debug')('@cypress/github-action')
6
5
  * a poor man's https://www.npmjs.com/package/wait-on. This version
7
6
  * is implemented using https://github.com/sindresorhus/got
8
7
  */
9
- const ping = (url, timeout) => {
8
+ const ping = async (url, timeout) => {
10
9
  if (!timeout) {
11
10
  throw new Error('Expected timeout in ms')
12
11
  }
13
12
 
13
+ // got@16 is ESM-only; dynamic import works from CommonJS
14
+ const { default: got } = await import('got')
15
+
14
16
  // make copy of the error codes that "got" retries on
15
17
  const errorCodes = [...got.defaults.options.retry.errorCodes]
16
18
  errorCodes.push('ESOCKETTIMEDOUT')
@@ -34,9 +36,14 @@ const ping = (url, timeout) => {
34
36
  headers: {
35
37
  Accept: 'text/html, application/json, text/plain, */*'
36
38
  },
37
- timeout: individualPingTimeout,
38
- errorCodes,
39
+ timeout: {
40
+ request: individualPingTimeout
41
+ },
39
42
  retry: {
43
+ errorCodes,
44
+ // enforceRetryRules:false lets calculateDelay be the sole stop condition,
45
+ // matching got@11 behaviour. limit is a generous failsafe only.
46
+ enforceRetryRules: false,
40
47
  limit,
41
48
  calculateDelay({ error, attemptCount }) {
42
49
  if (error) {
@@ -49,10 +56,9 @@ const ping = (url, timeout) => {
49
56
  )
50
57
  if (elapsed > timeout) {
51
58
  console.error(
52
- '%s timed out on retry %d of %d, elapsed %dms, limit %dms',
59
+ '%s timed out after %d retries, elapsed %dms, limit %dms',
53
60
  url,
54
61
  attemptCount,
55
- limit,
56
62
  elapsed,
57
63
  timeout
58
64
  )