From 7f19e450d072bda0490315439f215d92cf7a1cf3 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sat, 14 Sep 2024 16:08:48 +0200 Subject: [PATCH] Bump to node v20 (#47) --- .devcontainer/Dockerfile | 5 ++--- .github/workflows/build-push-release.yml | 2 +- .github/workflows/test.yml | 2 +- README.md | 4 ++++ action.yml | 2 +- azure-pipelines.yml | 3 ++- eslint.config.mjs | 4 ++-- package-lock.json | 3 +++ package.json | 3 +++ tsconfig.json | 2 +- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0a67f45..376e4ca 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,5 @@ # Use the official Node.js image as a parent image -#FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18 -FROM mcr.microsoft.com/devcontainers/typescript-node:18 +FROM mcr.microsoft.com/devcontainers/typescript-node:20 # Add a label to name your image LABEL name="relabeler-dev" @@ -9,7 +8,7 @@ LABEL name="relabeler-dev" # Debian version should be the same as the base image. ENV DEBIAN_VERSION=12 ENV DOTNET_SDK_VERSION=8.0 -ENV NODE_VERSION=18 +ENV NODE_VERSION=20 # Install additional OS packages and .NET SDK # hadolint ignore=DL3008 diff --git a/.github/workflows/build-push-release.yml b/.github/workflows/build-push-release.yml index 9c7d8df..239f908 100644 --- a/.github/workflows/build-push-release.yml +++ b/.github/workflows/build-push-release.yml @@ -40,7 +40,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: "18.x" + node-version: "20.x" # Install dependencies - name: Install dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index be3f294..1c89e72 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,7 +45,7 @@ jobs: if: success() uses: actions/setup-node@v4 with: - node-version: "18.x" + node-version: "20.x" - name: Install dependencies if: success() diff --git a/README.md b/README.md index 49d4bf9..35fc220 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ A GitHub Action that labels issues and pull requests on events. +## Requirements + +- Node.js v20 or higher + ## Usage To use this action, create a workflow file (e.g., `.github/workflows/relabeler.yml`) in your repository with the following content: diff --git a/action.yml b/action.yml index 9c6f54f..a859223 100644 --- a/action.yml +++ b/action.yml @@ -1,7 +1,7 @@ name: "relabeler" description: "A GitHub Action that is able to label issues and pull requests on events." runs: - using: "node16" + using: "node20" main: "dist/index.js" inputs: who-to-greet: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 577a66b..3b0a8e2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,3 +1,4 @@ +# This is the Azure Pipelines configuration for the relabeler project. IT IS NOT ACTIVATED. trigger: branches: include: @@ -16,7 +17,7 @@ pool: steps: - task: NodeTool@0 inputs: - versionSpec: "18.x" + versionSpec: "20.x" displayName: "Install Node.js" - script: | diff --git a/eslint.config.mjs b/eslint.config.mjs index 8efdf79..3b0acc7 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -8,11 +8,11 @@ export default [ languageOptions: { globals: { ...globals.node, - ...globals.es2020 + ...globals.es2022 }, parser: ts_eslint.parser, parserOptions: { - ecmaVersion: 2020, + ecmaVersion: 2022, sourceType: 'module' }, }, diff --git a/package-lock.json b/package-lock.json index fe7ed89..f995599 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,9 @@ "ts-jest": "^29.1.1", "typescript": "5.5.4", "typescript-eslint": "^8.5.0" + }, + "engines": { + "node": ">=20.0.0" } }, "node_modules/@actions/core": { diff --git a/package.json b/package.json index 1c45cdd..60deaca 100644 --- a/package.json +++ b/package.json @@ -51,5 +51,8 @@ "reportTestSuiteErrors": "true", "includeConsoleOutput": "true", "ancestorSeparator": " :: " + }, + "engines": { + "node": ">=20.0.0" } } diff --git a/tsconfig.json b/tsconfig.json index 3817b08..3e8b98c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ /* Language and Environment */ - "target": "ES2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "target": "ES2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "jsx": "preserve", /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */