Skip to content

Upgrade to Node 22 #4461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 15 additions & 15 deletions .github/download-artifacts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@
* under the License.
*/

'use strict'

const core = require('@actions/core')
const { join } = require('path')
const minimist = require('minimist')
const stream = require('stream')
const { promisify } = require('util')
const { createWriteStream, promises } = require('fs')
const rimraf = require('rimraf')
const fetch = require('node-fetch')
const crossZip = require('cross-zip')
import core from '@actions/core'
import { join, dirname } from 'path'
import { fileURLToPath } from 'url'
import minimist from 'minimist'
import stream from 'stream'
import { promisify } from 'util'
import { createWriteStream, promises } from 'fs'
import { rimraf } from 'rimraf'
import fetch from 'node-fetch'
import crossZip from 'cross-zip'

const { mkdir, rename, readdir, unlink } = promises
const pipeline = promisify(stream.pipeline)
const unzip = promisify(crossZip.unzip)
const rm = promisify(rimraf)

const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const esFolder = join(__dirname, '..', '..', 'artifacts')
const zipFolder = join(esFolder, 'artifacts.zip')
const downloadedSpec = join(esFolder, 'rest-api-spec', 'api')
Expand All @@ -57,8 +57,8 @@ async function downloadArtifacts (opts) {
core.info(`Resolved artifact URL for ${resolved.commit_url}`)

core.info('Cleanup')
await rm(esFolder)
await rm(specFolder)
await rimraf(esFolder)
await rimraf(specFolder)
await mkdir(esFolder, { recursive: true })
await mkdir(specFolder, { recursive: true })

Expand All @@ -74,7 +74,7 @@ async function downloadArtifacts (opts) {
await unzip(zipFolder, esFolder)

core.info('Cleanup')
await rm(zipFolder)
await rimraf(zipFolder)

core.info('Moving files')
const files = await readdir(downloadedSpec)
Expand Down
5 changes: 3 additions & 2 deletions .github/download-artifacts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "download-artifacts",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -13,7 +14,7 @@
"@actions/core": "^1.6.0",
"cross-zip": "^4.0.0",
"minimist": "^1.2.5",
"node-fetch": "^2.6.7",
"rimraf": "^3.0.2"
"node-fetch": "^3",
"rimraf": "^6"
}
}
2 changes: 1 addition & 1 deletion .github/validate-pr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import assert from 'assert'
import * as core from '@actions/core'
import { copyFile } from 'fs/promises'
import * as github from '@actions/github'
import specification from '../../output/schema/schema.json' assert { type: 'json' }
import specification from '../../output/schema/schema.json' with { type: 'json' }
import { run as getReport } from '../../../clients-flight-recorder/scripts/types-validator/index.js'
import {
getNamespace,
Expand Down
2 changes: 1 addition & 1 deletion .github/validate-pr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/github": "^5.0.0",
"zx": "^4.3.0"
"zx": "^8"
}
}
4 changes: 2 additions & 2 deletions .github/workflows/code-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Install
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compiler-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Install deps
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compiler.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Install deps
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
token: ${{ secrets.PAT }}
persist-credentials: true

- name: Setup Node 20
- name: Setup Node 22
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: npm
cache-dependency-path: '**/package-lock.json'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Install
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-rest-api-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
with:
ref: ${{ matrix.branch }}

- name: Use Node.js 20
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Install deps
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
token: ${{ secrets.PAT }}
ref: main

- name: Use Node.js 20
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Install deps 1/2
working-directory: ./clients-flight-recorder
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
Loading
Loading