Skip to content

Commit 98357b1

Browse files
authored
feat: v8 (#4260)
1 parent 41c0e4b commit 98357b1

File tree

11 files changed

+170
-220
lines changed

11 files changed

+170
-220
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v6
2323
- uses: actions/setup-node@v6
2424
with:
25-
node-version: 20.x
25+
node-version-file: package.json
2626
cache: npm
2727
- run: npm ci
2828
- run: npm run build

.github/workflows/update-major-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ on:
1111
type: choice
1212
description: The major version tag to update
1313
options:
14-
- v6
1514
- v7
15+
- v8
1616

1717
jobs:
1818
tag:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Create Pull Request action will:
2121

2222
- [Concepts, guidelines and advanced usage](docs/concepts-guidelines.md)
2323
- [Examples](docs/examples.md)
24-
- [Updating to v7](docs/updating.md)
24+
- [Updating between versions](docs/updating.md)
2525
- [Common issues](docs/common-issues.md)
2626

2727
## Usage

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ outputs:
9494
pull-request-branch:
9595
description: 'The pull request branch name'
9696
runs:
97-
using: 'node20'
97+
using: 'node24'
9898
main: 'dist/index.js'
9999
branding:
100100
icon: 'git-pull-request'

dist/index.js

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10020,7 +10020,7 @@ module.exports = {
1002010020

1002110021

1002210022
const { parseSetCookie } = __nccwpck_require__(7803)
10023-
const { stringify, getHeadersList } = __nccwpck_require__(6338)
10023+
const { stringify } = __nccwpck_require__(6338)
1002410024
const { webidl } = __nccwpck_require__(8134)
1002510025
const { Headers } = __nccwpck_require__(9061)
1002610026

@@ -10096,14 +10096,13 @@ function getSetCookies (headers) {
1009610096

1009710097
webidl.brandCheck(headers, Headers, { strict: false })
1009810098

10099-
const cookies = getHeadersList(headers).cookies
10099+
const cookies = headers.getSetCookie()
1010010100

1010110101
if (!cookies) {
1010210102
return []
1010310103
}
1010410104

10105-
// In older versions of undici, cookies is a list of name:value.
10106-
return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
10105+
return cookies.map((pair) => parseSetCookie(pair))
1010710106
}
1010810107

1010910108
/**
@@ -10531,14 +10530,15 @@ module.exports = {
1053110530
/***/ }),
1053210531

1053310532
/***/ 6338:
10534-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
10533+
/***/ ((module) => {
1053510534

1053610535
"use strict";
1053710536

1053810537

10539-
const assert = __nccwpck_require__(2613)
10540-
const { kHeadersList } = __nccwpck_require__(9411)
10541-
10538+
/**
10539+
* @param {string} value
10540+
* @returns {boolean}
10541+
*/
1054210542
function isCTLExcludingHtab (value) {
1054310543
if (value.length === 0) {
1054410544
return false
@@ -10799,31 +10799,13 @@ function stringify (cookie) {
1079910799
return out.join('; ')
1080010800
}
1080110801

10802-
let kHeadersListNode
10803-
10804-
function getHeadersList (headers) {
10805-
if (headers[kHeadersList]) {
10806-
return headers[kHeadersList]
10807-
}
10808-
10809-
if (!kHeadersListNode) {
10810-
kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
10811-
(symbol) => symbol.description === 'headers list'
10812-
)
10813-
10814-
assert(kHeadersListNode, 'Headers cannot be parsed')
10815-
}
10816-
10817-
const headersList = headers[kHeadersListNode]
10818-
assert(headersList)
10819-
10820-
return headersList
10821-
}
10822-
1082310802
module.exports = {
1082410803
isCTLExcludingHtab,
10825-
stringify,
10826-
getHeadersList
10804+
validateCookieName,
10805+
validateCookiePath,
10806+
validateCookieValue,
10807+
toIMFDate,
10808+
stringify
1082710809
}
1082810810

1082910811

@@ -12752,6 +12734,14 @@ const { isUint8Array, isArrayBuffer } = __nccwpck_require__(8253)
1275212734
const { File: UndiciFile } = __nccwpck_require__(3305)
1275312735
const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4346)
1275412736

12737+
let random
12738+
try {
12739+
const crypto = __nccwpck_require__(7598)
12740+
random = (max) => crypto.randomInt(0, max)
12741+
} catch {
12742+
random = (max) => Math.floor(Math.random(max))
12743+
}
12744+
1275512745
let ReadableStream = globalThis.ReadableStream
1275612746

1275712747
/** @type {globalThis['File']} */
@@ -12837,7 +12827,7 @@ function extractBody (object, keepalive = false) {
1283712827
// Set source to a copy of the bytes held by object.
1283812828
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
1283912829
} else if (util.isFormDataLike(object)) {
12840-
const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
12830+
const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
1284112831
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
1284212832

1284312833
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
@@ -14819,6 +14809,7 @@ const {
1481914809
isValidHeaderName,
1482014810
isValidHeaderValue
1482114811
} = __nccwpck_require__(555)
14812+
const util = __nccwpck_require__(9023)
1482214813
const { webidl } = __nccwpck_require__(8134)
1482314814
const assert = __nccwpck_require__(2613)
1482414815

@@ -15372,6 +15363,9 @@ Object.defineProperties(Headers.prototype, {
1537215363
[Symbol.toStringTag]: {
1537315364
value: 'Headers',
1537415365
configurable: true
15366+
},
15367+
[util.inspect.custom]: {
15368+
enumerable: false
1537515369
}
1537615370
})
1537715371

@@ -24548,6 +24542,20 @@ class Pool extends PoolBase {
2454824542
? { ...options.interceptors }
2454924543
: undefined
2455024544
this[kFactory] = factory
24545+
24546+
this.on('connectionError', (origin, targets, error) => {
24547+
// If a connection error occurs, we remove the client from the pool,
24548+
// and emit a connectionError event. They will not be re-used.
24549+
// Fixes https://github.com/nodejs/undici/issues/3895
24550+
for (const target of targets) {
24551+
// Do not use kRemoveClient here, as it will close the client,
24552+
// but the client cannot be closed in this state.
24553+
const idx = this[kClients].indexOf(target)
24554+
if (idx !== -1) {
24555+
this[kClients].splice(idx, 1)
24556+
}
24557+
}
24558+
})
2455124559
}
2455224560

2455324561
[kGetDispatcher] () {

docs/common-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ So the straightforward solution is to just not install them during the workflow
3737

3838
- If hooks are automatically enabled by a framework, use an option provided by the framework to disable them. For example, for Husky users, they can be disabled with the `--ignore-scripts` flag, or by setting the `HUSKY` environment variable when the action runs.
3939
```yml
40-
uses: peter-evans/create-pull-request@v7
40+
uses: peter-evans/create-pull-request@v8
4141
env:
4242
HUSKY: '0'
4343
```

docs/concepts-guidelines.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ In these cases, you *must supply* the `base` input so the action can rebase chan
9292
Workflows triggered by [`pull_request`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request) events will by default check out a merge commit. Set the `base` input as follows to base the new pull request on the current pull request's branch.
9393

9494
```yml
95-
- uses: peter-evans/create-pull-request@v7
95+
- uses: peter-evans/create-pull-request@v8
9696
with:
9797
base: ${{ github.head_ref }}
9898
```
9999

100100
Workflows triggered by [`release`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release) events will by default check out a tag. For most use cases, you will need to set the `base` input to the branch name of the tagged commit.
101101

102102
```yml
103-
- uses: peter-evans/create-pull-request@v7
103+
- uses: peter-evans/create-pull-request@v8
104104
with:
105105
base: main
106106
```
@@ -186,7 +186,7 @@ Checking out a branch from a different repository from where the workflow is exe
186186
187187
# Make changes to pull request here
188188
189-
- uses: peter-evans/create-pull-request@v7
189+
- uses: peter-evans/create-pull-request@v8
190190
with:
191191
token: ${{ secrets.PAT }}
192192
```
@@ -217,7 +217,7 @@ How to use SSH (deploy keys) with create-pull-request action:
217217
# Make changes to pull request here
218218
219219
- name: Create Pull Request
220-
uses: peter-evans/create-pull-request@v7
220+
uses: peter-evans/create-pull-request@v8
221221
```
222222

223223
### Push pull request branches to a fork
@@ -242,7 +242,7 @@ It will use their own fork to push code and create the pull request.
242242
243243
# Make changes to pull request here
244244
245-
- uses: peter-evans/create-pull-request@v7
245+
- uses: peter-evans/create-pull-request@v8
246246
with:
247247
token: ${{ secrets.MACHINE_USER_PAT }}
248248
push-to-fork: machine-user/fork-of-repository
@@ -285,7 +285,7 @@ The following is an example of pushing to a fork using GitHub App tokens.
285285
# Make changes to pull request here
286286
287287
- name: Create Pull Request
288-
uses: peter-evans/create-pull-request@v7
288+
uses: peter-evans/create-pull-request@v8
289289
with:
290290
branch-token: ${{ steps.generate-token.outputs.token }}
291291
push-to-fork: owner/fork-of-repo
@@ -330,7 +330,7 @@ GitHub App generated tokens can be configured with fine-grained permissions and
330330
# Make changes to pull request here
331331
332332
- name: Create Pull Request
333-
uses: peter-evans/create-pull-request@v7
333+
uses: peter-evans/create-pull-request@v8
334334
with:
335335
token: ${{ steps.generate-token.outputs.token }}
336336
```
@@ -358,7 +358,7 @@ In the following example, a pull request is being created in remote repo `owner/
358358
# Make changes to pull request here
359359
360360
- name: Create Pull Request
361-
uses: peter-evans/create-pull-request@v7
361+
uses: peter-evans/create-pull-request@v8
362362
with:
363363
token: ${{ steps.generate-token.outputs.token }}
364364
```
@@ -387,7 +387,7 @@ In this example the `token` input is not supplied, so the action will use the re
387387
# Make changes to pull request here
388388
389389
- name: Create Pull Request
390-
uses: peter-evans/create-pull-request@v7
390+
uses: peter-evans/create-pull-request@v8
391391
with:
392392
sign-commits: true
393393
```
@@ -406,7 +406,7 @@ In this example, the `token` input is generated using a GitHub App. This will si
406406
# Make changes to pull request here
407407
408408
- name: Create Pull Request
409-
uses: peter-evans/create-pull-request@v7
409+
uses: peter-evans/create-pull-request@v8
410410
with:
411411
token: ${{ steps.generate-token.outputs.token }}
412412
sign-commits: true
@@ -449,7 +449,7 @@ The action can use GPG to sign commits with a GPG key that you generate yourself
449449
# Make changes to pull request here
450450
451451
- name: Create Pull Request
452-
uses: peter-evans/create-pull-request@v7
452+
uses: peter-evans/create-pull-request@v8
453453
with:
454454
token: ${{ secrets.PAT }}
455455
committer: example <[email protected]>
@@ -479,7 +479,7 @@ jobs:
479479
# Make changes to pull request here
480480

481481
- name: Create Pull Request
482-
uses: peter-evans/create-pull-request@v7
482+
uses: peter-evans/create-pull-request@v8
483483
```
484484
485485
**Ubuntu container example:**
@@ -502,5 +502,5 @@ jobs:
502502
# Make changes to pull request here
503503

504504
- name: Create Pull Request
505-
uses: peter-evans/create-pull-request@v7
505+
uses: peter-evans/create-pull-request@v8
506506
```

0 commit comments

Comments
 (0)