Skip to content

Commit 08357c8

Browse files
authored
Update Supported Node.js Version to 24 (#216)
This pull request updates the Node.js version requirements for the project and bumps the package version to reflect the change. These updates ensure compatibility with newer Node.js releases and signal the change to consumers.
2 parents 46df3e5 + 9ad3422 commit 08357c8

9 files changed

Lines changed: 93 additions & 93 deletions

File tree

.github/workflows/continuous-integration.yml

Lines changed: 48 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ jobs:
5252
typescript-esm-npm:
5353
strategy:
5454
matrix:
55-
os: [ubuntu-latest, windows-latest]
55+
os:
56+
- ubuntu-latest
57+
- windows-latest
5658

5759
name: TypeScript ESM (npm)
5860
runs-on: ${{ matrix.os }}
@@ -86,7 +88,9 @@ jobs:
8688

8789
- name: Install TypeScript Template Dependencies
8890
id: install-typescript
89-
run: npm ci
91+
run: |
92+
npm ci
93+
npm uninstall @github/local-action
9094
working-directory: typescript-action
9195

9296
- name: Link @github/local-action
@@ -109,7 +113,9 @@ jobs:
109113
javascript-esm-npm:
110114
strategy:
111115
matrix:
112-
os: [ubuntu-latest, windows-latest]
116+
os:
117+
- ubuntu-latest
118+
- windows-latest
113119

114120
name: JavaScript ESM (npm)
115121
runs-on: ${{ matrix.os }}
@@ -143,7 +149,9 @@ jobs:
143149

144150
- name: Install JavaScript Template Dependencies
145151
id: install-javascript
146-
run: npm ci
152+
run: |
153+
npm ci
154+
npm uninstall @github/local-action
147155
working-directory: javascript-action
148156

149157
- name: Link @github/local-action
@@ -166,7 +174,9 @@ jobs:
166174
typescript-esm-pnpm:
167175
strategy:
168176
matrix:
169-
os: [ubuntu-latest, windows-latest]
177+
os:
178+
- ubuntu-latest
179+
- windows-latest
170180

171181
name: TypeScript ESM (pnpm)
172182
runs-on: ${{ matrix.os }}
@@ -206,14 +216,21 @@ jobs:
206216

207217
- name: Install TypeScript Template Dependencies
208218
id: install-typescript
209-
run: pnpm install
219+
run: |
220+
pnpm install
221+
pnpm uninstall @github/local-action
210222
working-directory: typescript-pnpm-esm-action
211223

212-
- name: Link @github/local-action
213-
id: link
214-
run: pnpm link
224+
- name: Create Global Link
225+
id: create-link
226+
run: npm link
215227
working-directory: local-action
216228

229+
- name: Use Global Link
230+
id: use-link
231+
run: pnpm link "${{ github.workspace }}/local-action"
232+
working-directory: typescript-pnpm-esm-action
233+
217234
- name: Generate Dotenv File
218235
id: dotenv
219236
run: |
@@ -229,7 +246,9 @@ jobs:
229246
typescript-cjs-pnpm:
230247
strategy:
231248
matrix:
232-
os: [ubuntu-latest, windows-latest]
249+
os:
250+
- ubuntu-latest
251+
- windows-latest
233252

234253
name: TypeScript CJS (pnpm)
235254
runs-on: ${{ matrix.os }}
@@ -269,14 +288,21 @@ jobs:
269288

270289
- name: Install TypeScript Template Dependencies
271290
id: install-typescript
272-
run: pnpm install
291+
run: |
292+
pnpm install
293+
pnpm uninstall @github/local-action
273294
working-directory: typescript-pnpm-cjs-action
274295

275-
- name: Link @github/local-action
276-
id: link
277-
run: pnpm link
296+
- name: Create Global Link
297+
id: create-link
298+
run: npm link
278299
working-directory: local-action
279300

301+
- name: Use Global Link
302+
id: use-link
303+
run: pnpm link "${{ github.workspace }}/local-action"
304+
working-directory: typescript-pnpm-cjs-action
305+
280306
- name: Generate Dotenv File
281307
id: dotenv
282308
run: |
@@ -333,11 +359,16 @@ jobs:
333359
yarn install
334360
working-directory: typescript-yarn-esm-action
335361

336-
- name: Link @github/local-action
337-
id: link
338-
run: yarn link
362+
- name: Create Global Link
363+
id: create-link
364+
run: npm link
339365
working-directory: local-action
340366

367+
- name: Use Global Link
368+
id: use-link
369+
run: yarn link "${{ github.workspace }}/local-action"
370+
working-directory: typescript-yarn-esm-action
371+
341372
- name: Generate Dotenv File
342373
id: dotenv
343374
run: |

.grype.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# upon scanning, if a severity is found at or above the given severity then the return code will be 1
1414
# default is unset which will skip this validation (options: negligible, low, medium, high, critical)
1515
# same as --fail-on ; GRYPE_FAIL_ON_SEVERITY env var
16-
fail-on-severity: 'high'
16+
fail-on-severity: high
1717

1818
# the output format of the vulnerability report (options: table, json, cyclonedx)
1919
# same as -o ; GRYPE_OUTPUT env var
@@ -145,7 +145,7 @@ exclude:
145145
# stock:
146146
# using-cpes: true
147147

148-
# ignore:
149-
# # Ignored by default; disputed and unwarranted CVE that causes Megalinter to fail
150-
# # @link https://nvd.nist.gov/vuln/detail/CVE-2018-20225
151-
# - vulnerability: CVE-2018-20225
148+
ignore:
149+
- package:
150+
name: stdlib
151+
type: go-module

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.9.0
1+
24.4.0

bin/local-action.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,6 @@ function entrypoint() {
2525
// Get the absolute path to the `@github/local-action` package.
2626
const packagePath = path.resolve(__dirname, '..')
2727

28-
// Get the absolute path to the bootstrap script. On Windows systems, this
29-
// need to be double-escaped so the path resolves correctly.
30-
const bootstrapPath =
31-
process.platform === 'win32'
32-
? path.join(packagePath, 'src', 'bootstrap.ts').replaceAll('\\', '\\\\')
33-
: path.join(packagePath, 'src', 'bootstrap.ts')
34-
35-
// Require the bootstrap script in NODE_OPTIONS.
36-
process.env.NODE_OPTIONS = process.env.NODE_OPTIONS
37-
? `${process.env.NODE_OPTIONS} --require "${bootstrapPath}"`
38-
: `--require "${bootstrapPath}"`
39-
4028
// Disable experimental warnings.
4129
process.env.NODE_NO_WARNINGS = 1
4230

jest.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const config: JestConfigWithTsJest = {
77
coverageDirectory: 'coverage',
88
coveragePathIgnorePatterns: [
99
'node_modules',
10-
'src/bootstrap.ts',
1110
'src/types/quibble.d.ts',
1211
'src/commands/run.ts',
1312
'src/stubs/artifact/artifact.ts'

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@github/local-action",
33
"description": "Local Debugging for GitHub Actions",
4-
"version": "5.1.0",
4+
"version": "5.2.0",
55
"type": "module",
66
"author": "Nick Alteen <ncalteen@github.com>",
77
"private": false,
@@ -19,7 +19,7 @@
1919
"typescript"
2020
],
2121
"engines": {
22-
"node": "^20 || ^22"
22+
"node": "^20 || ^22 || ^24"
2323
},
2424
"exports": {
2525
".": "./src/index.ts"

src/bootstrap.ts

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/commands/run.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import { parse } from 'comment-json'
12
import { config } from 'dotenv'
23
import { createRequire } from 'module'
34
import { execSync } from 'node:child_process'
45
import path from 'path'
56
import * as quibble from 'quibble'
7+
import { loadConfig, register } from 'tsconfig-paths'
8+
import { fileURLToPath } from 'url'
69
import { ARTIFACT_STUBS } from '../stubs/artifact/artifact.js'
710
import { CORE_STUBS, CoreMeta } from '../stubs/core/core.js'
811
import { EnvMeta } from '../stubs/env.js'
@@ -30,6 +33,37 @@ export async function action(
3033
const fs = await import('fs')
3134
const YAML = await import('yaml')
3235

36+
if (process.env.TARGET_ACTION_PATH && process.env.TARGET_ACTION_PATH !== '') {
37+
// Check if the action has a `tsconfig.json` file.
38+
if (fs.existsSync(`${process.env.TARGET_ACTION_PATH}/tsconfig.json`)) {
39+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
40+
41+
// Load the `tsconfig.json` from the action directory.
42+
const actionTsConfig = parse(
43+
fs.readFileSync(
44+
`${process.env.TARGET_ACTION_PATH}/tsconfig.json`,
45+
'utf-8'
46+
)
47+
)
48+
49+
// Load the current `tsconfig.json` from the root of this directory.
50+
loadConfig(__dirname)
51+
52+
// Get the paths from the action's `tsconfig.json`, if any.
53+
// @ts-expect-error comment-json type mismatch
54+
const paths = actionTsConfig?.compilerOptions?.paths ?? {}
55+
56+
// Add any path mappings from the imported action. Replace the base URL with
57+
// the target action path.
58+
// @todo Should this take into account the previous `baseUrl` value?
59+
register({
60+
baseUrl: process.env.TARGET_ACTION_PATH,
61+
paths,
62+
addMatchAll: true
63+
})
64+
}
65+
}
66+
3367
CoreMeta.colors = {
3468
cyan: (msg: string) => console.log(chalk.cyan(msg)),
3569
blue: (msg: string) => console.log(chalk.blue(msg)),

0 commit comments

Comments
 (0)