Skip to content

Commit 9959c7a

Browse files
authored
Merge pull request #24 from getsentry/iw/node-20
Update Node version and dependencies
2 parents 6cb17fa + 9a92850 commit 9959c7a

File tree

7 files changed

+2151
-3391
lines changed

7 files changed

+2151
-3391
lines changed

.eslintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"@typescript-eslint/prefer-function-type": "warn",
3636
"@typescript-eslint/prefer-includes": "error",
3737
"@typescript-eslint/prefer-string-starts-ends-with": "error",
38-
"@typescript-eslint/promise-function-async": "error",
3938
"@typescript-eslint/require-array-sort-compare": "error",
4039
"@typescript-eslint/restrict-plus-operands": "error",
4140
"semi": "off",

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ jobs:
1111
test:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v1
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 12
17+
node-version: '>=20'
1818
- run: yarn install
19+
- run: yarn build
1920
- run: yarn lint
2021
- run: yarn test

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ outputs:
2727
pullRequest:
2828
description: Stringified pull request object
2929
runs:
30-
using: 'node16'
30+
using: 'node20'
3131
main: 'dist/index.js'

package.json

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
"private": true,
55
"description": "This checks current PR body for a dependent PR",
66
"main": "lib/index.js",
7+
"engines": {
8+
"node": ">=20"
9+
},
10+
"volta": {
11+
"node": "20.3.0",
12+
"yarn": "1.22.17"
13+
},
714
"scripts": {
815
"build": "yarn tsc",
916
"format": "yarn prettier --write **/*.ts",
@@ -36,27 +43,27 @@
3643
]
3744
},
3845
"dependencies": {
39-
"@actions/core": "^1.2.5",
40-
"@actions/github": "^4.0.0",
46+
"@actions/core": "^1.10.0",
47+
"@actions/github": "^6.0.0",
4148
"github-app-token": "^1.0.3"
4249
},
4350
"devDependencies": {
44-
"@types/jest": "^26.0.10",
45-
"@types/node": "^14.6.1",
46-
"@typescript-eslint/eslint-plugin": "^3.10.1",
47-
"@typescript-eslint/parser": "^3.10.1",
48-
"@vercel/ncc": "^0.24.0",
49-
"eslint": "^7.7.0",
50-
"eslint-config-sentry": "^1.43.0",
51-
"eslint-plugin-jest": "^23.20.0",
52-
"eslint-plugin-prettier": "^3.1.4",
51+
"@types/jest": "^29.5.12",
52+
"@types/node": "^20.11.28",
53+
"@typescript-eslint/eslint-plugin": "^7.2.0",
54+
"@typescript-eslint/parser": "^7.2.0",
55+
"@vercel/ncc": "^0.38.1",
56+
"eslint": "^8.57.0",
57+
"eslint-config-sentry": "^2.5.0",
58+
"eslint-plugin-jest": "^27.9.0",
59+
"eslint-plugin-prettier": "^5.1.3",
5360
"husky": "^4.2.5",
54-
"jest": "^26.4.2",
55-
"jest-circus": "^26.4.2",
56-
"js-yaml": "^3.13.1",
61+
"jest": "^29.7.0",
62+
"jest-circus": "^29.7.0",
63+
"js-yaml": "^4.1.0",
5764
"lint-staged": "^10.2.13",
58-
"prettier": "^2.1.1",
59-
"ts-jest": "^26.3.0",
60-
"typescript": "^4.0.2"
65+
"prettier": "^3.2.5",
66+
"ts-jest": "^29.1.2",
67+
"typescript": "^5.4.2"
6168
}
6269
}

src/main.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function run(): Promise<void> {
2424

2525
// We want to fetch the pull request on every run, if we use the workflow event
2626
// payload, the PR body text can be stale e.g. if you re-run a workflow
27-
const sourcePullRequest = await octokit.pulls.get({
27+
const sourcePullRequest = await octokit.rest.pulls.get({
2828
owner,
2929
repo,
3030
// @ts-ignore (typing is wrong for this)
@@ -52,7 +52,7 @@ async function run(): Promise<void> {
5252

5353
const [, targetOwner, targetRepo, targetPullRequestNumber] = matches;
5454

55-
const pullRequest = await octokit.pulls.get({
55+
const pullRequest = await octokit.rest.pulls.get({
5656
owner: targetOwner,
5757
repo: targetRepo,
5858
// @ts-ignore (typing is wrong for this)
@@ -65,7 +65,9 @@ async function run(): Promise<void> {
6565
core.setOutput('number', pullRequest.data.number);
6666
core.setOutput('pullRequest', JSON.stringify(pullRequest.data));
6767
} catch (error) {
68-
core.setFailed(error.message);
68+
if (error instanceof Error) {
69+
core.error(error.message);
70+
}
6971
}
7072
}
7173

src/wait.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export async function wait(milliseconds: number): Promise<string> {
1+
export function wait(milliseconds: number): Promise<string> {
22
return new Promise(resolve => {
33
if (isNaN(milliseconds)) {
44
throw new Error('milliseconds not a number');

0 commit comments

Comments
 (0)