Skip to content

Commit 996e85a

Browse files
authored
fix: update action runner to node 24 (#105)
This action now uses Node 24 as runner. We also converted it to ESM and updated to latest @actions/core
1 parent cfc6c5e commit 996e85a

11 files changed

Lines changed: 97 additions & 93 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v6
1515
- uses: actions/setup-node@v6
1616
with:
17-
node-version: '20'
17+
node-version: '24'
1818

1919
- run: npm ci
2020

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
24

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ outputs:
1414
jsonString:
1515
description: 'JSON string'
1616
runs:
17-
using: 'node20'
17+
using: 'node24'
1818
main: 'dist/index.js'

fixtures/full-example/issue.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
const { resolve } = require("path");
2-
const { readFileSync } = require("fs");
1+
import { readFileSync } from "node:fs";
2+
import { resolve } from "node:path";
3+
import { fileURLToPath } from "node:url";
34

5+
const __dirname = fileURLToPath(new URL(".", import.meta.url));
46
const issueBodyPath = resolve(__dirname, "issue-body.md");
57

6-
module.exports = readFileSync(issueBodyPath, "utf-8");
8+
export default readFileSync(issueBodyPath, "utf-8");
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
const { resolve } = require("path");
2-
const { readFileSync } = require("fs");
1+
import { readFileSync } from "node:fs";
2+
import { resolve } from "node:path";
3+
import { fileURLToPath } from "node:url";
34

5+
const __dirname = fileURLToPath(new URL(".", import.meta.url));
46
const issueBodyPath = resolve(__dirname, "issue-body.md");
57

6-
module.exports = readFileSync(issueBodyPath, "utf-8");
8+
export default readFileSync(issueBodyPath, "utf-8");
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
const { resolve } = require("path");
2-
const { readFileSync } = require("fs");
1+
import { readFileSync } from "node:fs";
2+
import { resolve } from "node:path";
3+
import { fileURLToPath } from "node:url";
34

5+
const __dirname = fileURLToPath(new URL(".", import.meta.url));
46
const issueBodyPath = resolve(__dirname, "issue-body.md");
57

6-
module.exports = readFileSync(issueBodyPath, "utf-8")
8+
export default readFileSync(issueBodyPath, "utf-8");

fixtures/readme-example/issue.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
const { resolve } = require("path");
2-
const { readFileSync } = require("fs");
1+
import { readFileSync } from "node:fs";
2+
import { resolve } from "node:path";
3+
import { fileURLToPath } from "node:url";
34

5+
const __dirname = fileURLToPath(new URL(".", import.meta.url));
46
const issueBodyPath = resolve(__dirname, "issue-body.md");
57

6-
module.exports = readFileSync(issueBodyPath, "utf-8");
8+
export default readFileSync(issueBodyPath, "utf-8");

index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// @ts-check
22

3-
const fs = require("fs");
4-
const yaml = require("js-yaml");
5-
const core = require("@actions/core");
3+
import fs from "node:fs";
4+
import yaml from "js-yaml";
5+
import * as core from "@actions/core";
66

77
/**
88
* @param {NodeJS.ProcessEnv} env
99
* @param {string} body
1010
* @param {fs} fs
1111
* @param {core} core
1212
*/
13-
async function run(env, body, fs, core) {
13+
export async function run(env, body, fs, core) {
1414
body = body ?? ""
1515
let form = {};
1616
try {
@@ -180,5 +180,3 @@ if (process.env.GITHUB_ACTIONS && process.env.NODE_ENV !== "test") {
180180

181181
run(process.env, body, fs, core);
182182
}
183-
184-
module.exports.run = run;

package-lock.json

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

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
"version": "3.2.3",
55
"description": "",
66
"main": "index.js",
7+
"type": "module",
78
"scripts": {
89
"build": "ncc build",
9-
"test": "jest ."
10+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js ."
1011
},
1112
"repository": {
1213
"type": "git",
@@ -20,7 +21,7 @@
2021
},
2122
"homepage": "https://github.com/stefanbuck/github-issue-parser#readme",
2223
"dependencies": {
23-
"@actions/core": "^2.0.1",
24+
"@actions/core": "^3.0.1",
2425
"js-yaml": "^4.1.1"
2526
},
2627
"devDependencies": {

0 commit comments

Comments
 (0)