Skip to content

Commit de1f993

Browse files
Merge branch 'v22.x' into 22.x/findPackageJSON
2 parents 3f31241 + a9980eb commit de1f993

File tree

1,371 files changed

+84547
-63694
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,371 files changed

+84547
-63694
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
# Actions
144144

145145
/.github/workflows/* @nodejs/actions
146+
/.github/workflows/create-release-proposal.yml @nodejs/releasers
146147
/tools/actions/* @nodejs/actions
147148

148149
# Test runner

.github/workflows/coverage-linux-without-intl.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ jobs:
7979
- name: Clean tmp
8080
run: rm -rf coverage/tmp && rm -rf out
8181
- name: Upload
82-
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
82+
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
8383
with:
8484
directory: ./coverage
85-
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/coverage-linux.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ jobs:
7979
- name: Clean tmp
8080
run: rm -rf coverage/tmp && rm -rf out
8181
- name: Upload
82-
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
82+
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
8383
with:
8484
directory: ./coverage
85-
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/coverage-windows.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ jobs:
7171
- name: Clean tmp
7272
run: npx rimraf ./coverage/tmp
7373
- name: Upload
74-
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
74+
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
7575
with:
7676
directory: ./coverage
77-
token: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# This action requires the following secrets to be set on the repository:
2-
# GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below
32
# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes
4-
# JENKINS_TOKEN: Jenkins token, to be used to check CI status
53

64
name: Create Release Proposal
75

@@ -11,12 +9,10 @@ on:
119
release-line:
1210
required: true
1311
type: number
14-
default: 23
1512
description: 'The release line (without dots or prefix). e.g: 22'
1613
release-date:
1714
required: true
1815
type: string
19-
default: YYYY-MM-DD
2016
description: The release date in YYYY-MM-DD format
2117

2218
concurrency: ${{ github.workflow }}
@@ -26,6 +22,7 @@ env:
2622

2723
permissions:
2824
contents: write
25+
pull-requests: write
2926

3027
jobs:
3128
releasePrepare:
@@ -36,16 +33,14 @@ jobs:
3633
RELEASE_LINE: ${{ inputs.release-line }}
3734
runs-on: ubuntu-latest
3835
steps:
39-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
36+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4037
with:
4138
ref: ${{ env.STAGING_BRANCH }}
42-
# Needs the whole git history for ncu to work
43-
# See https://github.com/nodejs/node-core-utils/pull/486
44-
fetch-depth: 0
39+
persist-credentials: false
4540

4641
# Install dependencies
4742
- name: Install Node.js
48-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
43+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
4944
with:
5045
node-version: ${{ env.NODE_VERSION }}
5146

@@ -56,31 +51,32 @@ jobs:
5651
run: |
5752
ncu-config set branch "${RELEASE_BRANCH}"
5853
ncu-config set upstream origin
59-
ncu-config set username "$USERNAME"
54+
ncu-config set username "$GITHUB_ACTOR"
6055
ncu-config set token "$GH_TOKEN"
61-
ncu-config set jenkins_token "$JENKINS_TOKEN"
6256
ncu-config set repo "$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)"
6357
ncu-config set owner "${GITHUB_REPOSITORY_OWNER}"
6458
env:
65-
USERNAME: ${{ secrets.JENKINS_USER }}
66-
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
67-
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
59+
GH_TOKEN: ${{ github.token }}
6860

6961
- name: Set up ghauth config (Ubuntu)
7062
run: |
71-
mkdir -p ~/.config/changelog-maker/
72-
echo '{
73-
"user": "'$(ncu-config get username)'",
74-
"token": "'$(ncu-config get token)'"
75-
}' > ~/.config/changelog-maker/config.json
63+
mkdir -p "${XDG_CONFIG_HOME:-~/.config}/changelog-maker"
64+
echo '{}' | jq '{user: env.GITHUB_ACTOR, token: env.TOKEN}' > "${XDG_CONFIG_HOME:-~/.config}/changelog-maker/config.json"
65+
env:
66+
TOKEN: ${{ github.token }}
7667

7768
- name: Setup git author
7869
run: |
7970
git config --local user.email "github-bot@iojs.org"
8071
git config --local user.name "Node.js GitHub Bot"
8172
8273
- name: Start git node release prepare
74+
# The curl command is to make sure we run the version of the script corresponding to the current workflow.
8375
run: |
84-
./tools/actions/create-release.sh "${RELEASE_DATE}" "${RELEASE_LINE}"
76+
git update-index --assume-unchanged tools/actions/create-release.sh
77+
curl -fsSLo tools/actions/create-release.sh https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/tools/actions/create-release.sh
78+
./tools/actions/create-release.sh "${RELEASE_DATE}" "${RELEASE_LINE}" "${GITHUB_ACTOR}"
8579
env:
86-
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
80+
GH_TOKEN: ${{ github.token }}
81+
# We want the bot to push the push the release commit so CI runs on it.
82+
BOT_TOKEN: ${{ secrets.GH_USER_TOKEN }}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Linters (release proposals)
2+
3+
on:
4+
push:
5+
branches:
6+
- v[0-9]+.[0-9]+.[0-9]+-proposal
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
env:
13+
PYTHON_VERSION: '3.12'
14+
NODE_VERSION: lts/*
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
lint-release-commit:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
with:
25+
persist-credentials: false
26+
- name: Lint release commit title format
27+
run: |
28+
EXPECTED_TITLE='^[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}, Version [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ (\(Current|'.+' \(LTS)\)$'
29+
echo "Expected commit title format: $EXPECTED_TITLE"
30+
COMMIT_SUBJECT="$(git --no-pager log -1 --format=%s)"
31+
echo "Actual: $ACTUAL"
32+
echo "$COMMIT_SUBJECT" | grep -q -E "$EXPECTED_TITLE"
33+
echo "COMMIT_SUBJECT=$COMMIT_SUBJECT" >> "$GITHUB_ENV"
34+
- name: Lint release commit message trailers
35+
run: |
36+
EXPECTED_TRAILER="^PR-URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pull/[[:digit:]]+\$"
37+
echo "Expected trailer format: $EXPECTED_TRAILER"
38+
ACTUAL="$(git --no-pager log -1 --format=%b | git interpret-trailers --parse --no-divider)"
39+
echo "Actual: $ACTUAL"
40+
echo "$ACTUAL" | grep -E -q "$EXPECTED_TRAILER"
41+
42+
PR_URL="${ACTUAL:8}"
43+
PR_HEAD="$(gh pr view "$PR_URL" --json headRefOid -q .headRefOid)"
44+
echo "Head of $PR_URL: $PR_HEAD"
45+
echo "Current commit: $GITHUB_SHA"
46+
[ "$PR_HEAD" = "$GITHUB_SHA" ]
47+
env:
48+
GH_TOKEN: ${{ github.token }}
49+
- name: Validate CHANGELOG
50+
id: releaser-info
51+
run: |
52+
EXPECTED_CHANGELOG_TITLE_INTRO="## $COMMIT_SUBJECT, @"
53+
echo "Expected CHANGELOG section title: $EXPECTED_CHANGELOG_TITLE_INTRO"
54+
CHANGELOG_TITLE="$(grep "$EXPECTED_CHANGELOG_TITLE_INTRO" "doc/changelogs/CHANGELOG_V${COMMIT_SUBJECT:20:2}.md")"
55+
echo "Actual: $CHANGELOG_TITLE"
56+
[ "${CHANGELOG_TITLE%%@*}@" = "$EXPECTED_CHANGELOG_TITLE_INTRO" ]
57+
- name: Verify NODE_VERSION_IS_RELEASE bit is correctly set
58+
run: |
59+
grep -q '^#define NODE_VERSION_IS_RELEASE 1$' src/node_version.h
60+
- name: Check for placeholders in documentation
61+
run: |
62+
! grep "REPLACEME" doc/api/*.md
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Major Release
2+
3+
on:
4+
schedule:
5+
- cron: 0 0 15 2,8 * # runs at midnight UTC every 15 February and 15 August
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
create-issue:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
issues: write
15+
steps:
16+
- name: Check for release schedule
17+
id: check-date
18+
run: |
19+
# Get the current month and day
20+
MONTH=$(date +'%m')
21+
DAY=$(date +'%d')
22+
# We'll create the reminder issue two months prior the release
23+
if [[ "$MONTH" == "02" || "$MONTH" == "08" ]] && [[ "$DAY" == "15" ]]; then
24+
echo "create_issue=true" >> "$GITHUB_ENV"
25+
fi
26+
- name: Retrieve next major release info from nodejs/Release
27+
if: env.create_issue == 'true'
28+
run: |
29+
curl -L https://github.com/nodejs/Release/raw/HEAD/schedule.json | \
30+
jq -r 'to_entries | map(select(.value.start | strptime("%Y-%m-%d") | mktime > now)) | first | "VERSION=" + .key + "\nRELEASE_DATE=" + .value.start' >> "$GITHUB_ENV"
31+
- name: Compute max date for landing semver-major PRs
32+
if: env.create_issue == 'true'
33+
run: |
34+
echo "PR_MAX_DATE=$(date -d "$RELEASE_DATE -1 month" +%Y-%m-%d)" >> "$GITHUB_ENV"
35+
- name: Create release announcement issue
36+
if: env.create_issue == 'true'
37+
run: |
38+
gh issue create --repo "${GITHUB_REPOSITORY}" \
39+
--title "Upcoming Node.js Major Release ($VERSION)" \
40+
--body-file -<<EOF
41+
A reminder that the next Node.js **SemVer Major release** is scheduled for **${RELEASE_DATE}**.
42+
All commits that were landed until **${PR_MAX_DATE}** (one month prior to the release) will be included in the next semver major release. Please ensure that any necessary preparations are made in advance.
43+
For more details on the release process, consult the [Node.js Release Working Group repository](https://github.com/nodejs/release).
44+
45+
cc: @nodejs/collaborators
46+
EOF
47+
env:
48+
GH_TOKEN: ${{ github.token }}

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
steps:
3535
- name: Harden Runner
36-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
36+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
3737
with:
3838
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
3939

@@ -73,6 +73,6 @@ jobs:
7373

7474
# Upload the results to GitHub's code scanning dashboard.
7575
- name: Upload to code-scanning
76-
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
76+
uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5
7777
with:
7878
sarif_file: results.sarif

.github/workflows/tools.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
- gyp-next
2828
- histogram
2929
- icu
30-
# - libuv
30+
- libuv
3131
- llhttp
3232
- minimatch
3333
- nbytes
@@ -51,7 +51,7 @@ permissions:
5151

5252
jobs:
5353
tools-deps-update:
54-
if: github.repository == 'nodejs/node'
54+
if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'
5555
runs-on: ubuntu-latest
5656
strategy:
5757
fail-fast: false # Prevent other jobs from aborting if one fails
@@ -175,17 +175,14 @@ jobs:
175175
cat temp-output
176176
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
177177
rm temp-output
178-
# libuv update was disabled because of Feb 14, 2024 security release
179-
# modified the bundled version of libuv, we cannot automatically update
180-
# libuv without potentially undoing those changes.
181-
# - id: libuv
182-
# subsystem: deps
183-
# label: dependencies
184-
# run: |
185-
# ./tools/dep_updaters/update-libuv.sh > temp-output
186-
# cat temp-output
187-
# tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
188-
# rm temp-output
178+
- id: libuv
179+
subsystem: deps
180+
label: dependencies
181+
run: |
182+
./tools/dep_updaters/update-libuv.sh > temp-output
183+
cat temp-output
184+
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
185+
rm temp-output
189186
- id: llhttp
190187
subsystem: deps
191188
label: dependencies

.github/workflows/update-wpt.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: WPT update
2+
3+
on:
4+
schedule:
5+
# Run once a week at 12:00 AM UTC on Sunday.
6+
- cron: 0 0 * * *
7+
workflow_dispatch:
8+
inputs:
9+
subsystems:
10+
description: Subsystem to run the update for
11+
required: false
12+
default: '["url", "WebCryptoAPI"]'
13+
14+
permissions:
15+
contents: read
16+
17+
env:
18+
NODE_VERSION: lts/*
19+
20+
jobs:
21+
wpt-subsystem-update:
22+
if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'
23+
runs-on: ubuntu-latest
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
subsystem: ${{ fromJSON(github.event.inputs.subsystems || '["url", "WebCryptoAPI"]') }}
28+
29+
steps:
30+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31+
with:
32+
persist-credentials: false
33+
34+
- name: Install Node.js
35+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
36+
with:
37+
node-version: ${{ env.NODE_VERSION }}
38+
39+
- name: Install @node-core/utils
40+
run: npm install -g @node-core/utils
41+
42+
- name: Setup @node-core/utils
43+
run: |
44+
ncu-config set username "$USERNAME"
45+
ncu-config set token "$GH_TOKEN"
46+
ncu-config set owner "${GITHUB_REPOSITORY_OWNER}"
47+
ncu-config set repo "$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)"
48+
env:
49+
USERNAME: ${{ secrets.JENKINS_USER }}
50+
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
51+
52+
- name: Update WPT for subsystem ${{ matrix.subsystem }}
53+
run: |
54+
git node wpt "$SUBSYSTEM"
55+
env:
56+
SUBSYSTEM: ${{ matrix.subsystem }}
57+
58+
- name: Retrieve new version commit
59+
run: |
60+
new_version="$(
61+
node -p 'require("./test/fixtures/wpt/versions.json")[process.argv[1]].commit' "$SUBSYSTEM"
62+
)"
63+
{
64+
echo "long_version=$new_version"
65+
echo "short_version=${new_version:0:10}"
66+
} >> "$GITHUB_ENV"
67+
env:
68+
SUBSYSTEM: ${{ matrix.subsystem }}
69+
70+
- name: Open or update PR for the subsystem update
71+
uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5
72+
with:
73+
branch: actions/update-wpt-${{ matrix.subsystem }}
74+
author: Node.js GitHub Bot <github-bot@iojs.org>
75+
title: 'test: update WPT for ${{ matrix.subsystem }} to ${{ env.short_version }}'
76+
commit-message: 'test: update WPT for ${{ matrix.subsystem }} to ${{ env.short_version }}'
77+
labels: test
78+
update-pull-request-title-and-body: true
79+
body: >
80+
This is an automated update of the WPT for ${{ matrix.subsystem }} to
81+
https://github.com/web-platform-tests/wpt/commit/${{ env.long_version }}.
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}

0 commit comments

Comments
 (0)