Skip to content

Commit 7381649

Browse files
authored
Merge pull request #199 from crazy-max/update-node20
chore: node 20 as default runtime
2 parents f6c8f77 + e4b824f commit 7381649

File tree

14 files changed

+1300
-981
lines changed

14 files changed

+1300
-981
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/dist/**
2+
/coverage/**
3+
/node_modules/**

.eslintrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"env": {
33
"node": true,
4-
"es2021": true,
5-
"jest/globals": true
4+
"es6": true,
5+
"jest": true
66
},
77
"extends": [
88
"eslint:recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
910
"plugin:@typescript-eslint/recommended",
1011
"plugin:jest/recommended",
1112
"plugin:prettier/recommended"

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 111 additions & 111 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.5.1.cjs renamed to .yarn/releases/yarn-3.6.3.cjs

Lines changed: 241 additions & 240 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
logFilters:
22
- code: YN0013
33
level: discard
4+
- code: YN0019
5+
level: discard
46
- code: YN0076
57
level: discard
68

@@ -10,4 +12,4 @@ plugins:
1012
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
1113
spec: "@yarnpkg/plugin-interactive-tools"
1214

13-
yarnPath: .yarn/releases/yarn-3.5.1.cjs
15+
yarnPath: .yarn/releases/yarn-3.6.3.cjs

__tests__/labeler.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {Inputs} from '../src/context';
33
import {Label, Labeler, LabelStatus} from '../src/labeler';
44

55
import repoLabels from './fixtures/repoLabels.json';
6+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
67
jest.spyOn(Labeler.prototype as any, 'getRepoLabels').mockImplementation((): Promise<Label[]> => {
78
return <Promise<Label[]>>(repoLabels as unknown);
89
});

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ inputs:
2828
required: true
2929

3030
runs:
31-
using: 'node16'
31+
using: 'node20'
3232
main: 'dist/index.js'

dev.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
ARG NODE_VERSION=16
3+
ARG NODE_VERSION=20
44

55
FROM node:${NODE_VERSION}-alpine AS base
66
RUN apk add --no-cache cpio findutils git
@@ -72,7 +72,7 @@ ARG GITHUB_REPOSITORY
7272
RUN --mount=type=bind,target=.,rw \
7373
--mount=type=cache,target=/src/.yarn/cache \
7474
--mount=type=cache,target=/src/node_modules \
75-
yarn run test --coverageDirectory=/tmp/coverage
75+
yarn run test --coverage --coverageDirectory=/tmp/coverage
7676

7777
FROM scratch AS test-coverage
7878
COPY --from=test /tmp/coverage /

dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jest.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
module.exports = {
22
clearMocks: true,
3+
testEnvironment: 'node',
34
moduleFileExtensions: ['js', 'ts'],
45
setupFiles: ['dotenv/config'],
56
testMatch: ['**/*.test.ts'],
67
transform: {
78
'^.+\\.ts$': 'ts-jest'
89
},
10+
collectCoverageFrom: ['src/**/{!(main.ts),}.ts'],
11+
coveragePathIgnorePatterns: ['dist/', 'node_modules/', '__tests__/'],
912
verbose: true
1013
};

package.json

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
"description": "GitHub Action to manage labels on GitHub",
44
"main": "src/main.ts",
55
"scripts": {
6-
"build": "ncc build --source-map --minify --license licenses.txt",
7-
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
8-
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
9-
"test": "jest --coverage"
6+
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
7+
"lint": "yarn run prettier && yarn run eslint",
8+
"format": "yarn run prettier:fix && yarn run eslint:fix",
9+
"eslint": "eslint --max-warnings=0 .",
10+
"eslint:fix": "eslint --fix .",
11+
"prettier": "prettier --check \"./**/*.ts\"",
12+
"prettier:fix": "prettier --write \"./**/*.ts\"",
13+
"test": "jest",
14+
"all": "yarn run build && yarn run format && yarn test"
1015
},
1116
"repository": {
1217
"type": "git",
@@ -19,27 +24,27 @@
1924
],
2025
"author": "CrazyMax",
2126
"license": "MIT",
22-
"packageManager": "yarn@3.5.1",
27+
"packageManager": "yarn@3.6.3",
2328
"dependencies": {
2429
"@actions/core": "^1.10.0",
2530
"@actions/github": "^5.1.1",
2631
"js-yaml": "^4.1.0",
2732
"matcher": "^3.0.0"
2833
},
2934
"devDependencies": {
30-
"@types/node": "^18.16.5",
31-
"@typescript-eslint/eslint-plugin": "^5.59.2",
32-
"@typescript-eslint/parser": "^5.59.2",
33-
"@vercel/ncc": "^0.36.1",
34-
"dotenv": "^16.0.3",
35-
"eslint": "^8.40.0",
36-
"eslint-config-prettier": "^8.8.0",
37-
"eslint-plugin-jest": "^27.2.1",
38-
"eslint-plugin-prettier": "^4.2.1",
39-
"jest": "^29.5.0",
40-
"prettier": "^2.8.8",
41-
"ts-jest": "^29.1.0",
35+
"@types/node": "^20.6.0",
36+
"@typescript-eslint/eslint-plugin": "^6.6.0",
37+
"@typescript-eslint/parser": "^6.6.0",
38+
"@vercel/ncc": "^0.38.0",
39+
"dotenv": "^16.3.1",
40+
"eslint": "^8.49.0",
41+
"eslint-config-prettier": "^9.0.0",
42+
"eslint-plugin-jest": "^27.2.3",
43+
"eslint-plugin-prettier": "^5.0.0",
44+
"jest": "^29.6.4",
45+
"prettier": "^3.0.3",
46+
"ts-jest": "^29.1.1",
4247
"ts-node": "^10.9.1",
43-
"typescript": "^4.9.5"
48+
"typescript": "^5.2.2"
4449
}
4550
}

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"compilerOptions": {
3+
"esModuleInterop": true,
34
"target": "es6",
45
"module": "commonjs",
56
"newLine": "lf",
67
"outDir": "./lib",
78
"rootDir": "./src",
8-
"esModuleInterop": true,
99
"forceConsistentCasingInFileNames": true,
10-
"strict": true,
1110
"noImplicitAny": false,
1211
"resolveJsonModule": true,
1312
"useUnknownInCatchVariables": false,

0 commit comments

Comments
 (0)