Use node24 instead of node20 (#608)

This commit is contained in:
Kevin Stillhammer
2025-10-07 08:44:57 +02:00
committed by GitHub
parent d9ee7e2f26
commit 3deccc0075
9 changed files with 54 additions and 40 deletions

View File

@@ -7,3 +7,7 @@ self-hosted-runner:
# organization. `null` means disabling configuration variables check.
# Empty array means no configuration variable is allowed.
config-variables: null
paths:
.github/workflows/test.yml:
ignore:
- 'invalid runner name.+'

View File

@@ -30,7 +30,7 @@ jobs:
uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: "20"
node-version: "24"
- run: |
npm install
- run: |

View File

@@ -84,7 +84,7 @@ outputs:
cache-hit:
description: "A boolean value to indicate a cache entry was found"
runs:
using: "node20"
using: "node24"
main: "dist/setup/index.js"
post: "dist/save-cache/index.js"
post-if: success()

3
dist/setup/index.js generated vendored
View File

@@ -129771,7 +129771,8 @@ const DEFAULTS = {
baseUrl: "https://api.github.com",
userAgent: "setup-uv",
};
exports.Octokit = core_1.Octokit.plugin(plugin_paginate_rest_1.paginateRest, plugin_rest_endpoint_methods_1.legacyRestEndpointMethods).defaults(function buildDefaults(options) {
const OctokitWithPlugins = core_1.Octokit.plugin(plugin_paginate_rest_1.paginateRest, plugin_rest_endpoint_methods_1.legacyRestEndpointMethods);
exports.Octokit = OctokitWithPlugins.defaults(function buildDefaults(options) {
return {
...DEFAULTS,
...options,

View File

@@ -65801,7 +65801,8 @@ const DEFAULTS = {
baseUrl: "https://api.github.com",
userAgent: "setup-uv",
};
exports.Octokit = core_1.Octokit.plugin(plugin_paginate_rest_1.paginateRest, plugin_rest_endpoint_methods_1.legacyRestEndpointMethods).defaults(function buildDefaults(options) {
const OctokitWithPlugins = core_1.Octokit.plugin(plugin_paginate_rest_1.paginateRest, plugin_rest_endpoint_methods_1.legacyRestEndpointMethods);
exports.Octokit = OctokitWithPlugins.defaults(function buildDefaults(options) {
return {
...DEFAULTS,
...options,

View File

@@ -2,6 +2,7 @@ import { promises as fs } from "node:fs";
import * as path from "node:path";
import * as core from "@actions/core";
import * as tc from "@actions/tool-cache";
import type { Endpoints } from "@octokit/types";
import * as pep440 from "@renovatebot/pep440";
import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants";
import { Octokit } from "../utils/octokit";
@@ -12,6 +13,9 @@ import {
getLatestKnownVersion as getLatestVersionInManifest,
} from "./version-manifest";
type Release =
Endpoints["GET /repos/{owner}/{repo}/releases"]["response"]["data"][number];
export function tryGetFromToolCache(
arch: Architecture,
version: string,
@@ -186,13 +190,14 @@ async function getAvailableVersions(githubToken: string): Promise<string[]> {
}
}
async function getReleaseTagNames(
octokit: InstanceType<typeof Octokit>,
): Promise<string[]> {
const response = await octokit.paginate(octokit.rest.repos.listReleases, {
async function getReleaseTagNames(octokit: Octokit): Promise<string[]> {
const response: Release[] = await octokit.paginate(
octokit.rest.repos.listReleases,
{
owner: OWNER,
repo: REPO,
});
},
);
const releaseTagNames = response.map((release) => release.tag_name);
if (releaseTagNames.length === 0) {
throw Error(
@@ -233,7 +238,7 @@ async function getLatestVersion(githubToken: string) {
return latestRelease.tag_name;
}
async function getLatestRelease(octokit: InstanceType<typeof Octokit>) {
async function getLatestRelease(octokit: Octokit) {
const { data: latestRelease } = await octokit.rest.repos.getLatestRelease({
owner: OWNER,
repo: REPO,

View File

@@ -1,4 +1,5 @@
import * as core from "@actions/core";
import type { Endpoints } from "@octokit/types";
import * as semver from "semver";
import { updateChecksums } from "./download/checksum/update-known-checksums";
import {
@@ -8,6 +9,9 @@ import {
import { OWNER, REPO } from "./utils/constants";
import { Octokit } from "./utils/octokit";
type Release =
Endpoints["GET /repos/{owner}/{repo}/releases"]["response"]["data"][number];
async function run(): Promise<void> {
const checksumFilePath = process.argv.slice(2)[0];
const versionsManifestFile = process.argv.slice(2)[1];
@@ -31,10 +35,13 @@ async function run(): Promise<void> {
return;
}
const releases = await octokit.paginate(octokit.rest.repos.listReleases, {
const releases: Release[] = await octokit.paginate(
octokit.rest.repos.listReleases,
{
owner: OWNER,
repo: REPO,
});
},
);
const checksumDownloadUrls: string[] = releases.flatMap((release) =>
release.assets
.filter((asset) => asset.name.endsWith(".sha256"))

View File

@@ -1,8 +1,5 @@
import type { OctokitOptions } from "@octokit/core";
import { Octokit as Core } from "@octokit/core";
import type {
Constructor,
OctokitOptions,
} from "@octokit/core/dist-types/types";
import {
type PaginateInterface,
paginateRest,
@@ -17,13 +14,11 @@ const DEFAULTS = {
userAgent: "setup-uv",
};
export const Octokit: typeof Core &
Constructor<
{
paginate: PaginateInterface;
} & ReturnType<typeof legacyRestEndpointMethods>
> = Core.plugin(paginateRest, legacyRestEndpointMethods).defaults(
function buildDefaults(options: OctokitOptions): OctokitOptions {
const OctokitWithPlugins = Core.plugin(paginateRest, legacyRestEndpointMethods);
export const Octokit = OctokitWithPlugins.defaults(function buildDefaults(
options: OctokitOptions,
): OctokitOptions {
return {
...DEFAULTS,
...options,
@@ -32,7 +27,8 @@ export const Octokit: typeof Core &
...options.request,
},
};
},
);
});
export type Octokit = InstanceType<typeof Octokit>;
export type Octokit = InstanceType<typeof OctokitWithPlugins> & {
paginate: PaginateInterface;
};

View File

@@ -1,12 +1,12 @@
{
"compilerOptions": {
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"module": "nodenext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
"outDir": "./lib" /* Redirect output structure to the directory. */,
"rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
"strict": true /* Enable all strict type-checking options. */,
"target": "ES2022" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"target": "ES2024" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
},
"exclude": ["node_modules", "**/*.test.ts"]
}