Skip to content

Commit 914e1be

Browse files
committed
Update action to use the correct version of node
1 parent 053772b commit 914e1be

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

.github/actions/info/build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ const buildCommand = getBuildCommand({
55
entryPoints: ['./index.ts'],
66
format: 'esm',
77
outfile: './dist.js',
8-
packages: 'external'
8+
packages: 'external',
9+
target: 'node20'
910
});
1011

1112
await buildCommand.parseAsync();

.github/actions/info/dist.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import pathlib from "path";
44
import * as core from "@actions/core";
55
import { getExecOutput } from "@actions/exec";
66
async function findPackages(directory, maxDepth) {
7+
const output = [];
78
async function* recurser(currentDir, currentDepth) {
89
if (maxDepth !== void 0 && currentDepth >= maxDepth) return;
910
const items = await fs.readdir(currentDir, { withFileTypes: true });
@@ -15,12 +16,15 @@ async function findPackages(directory, maxDepth) {
1516
}
1617
continue;
1718
}
18-
if (item.isDirectory() && item.name !== "node__modules") {
19+
if (item.isDirectory() && item.name !== "node_modules") {
1920
yield* recurser(fullPath, currentDepth + 1);
2021
}
2122
}
2223
}
23-
return Array.fromAsync(recurser(directory, 0));
24+
for await (const each of recurser(directory, 0)) {
25+
output.push(each);
26+
}
27+
return output;
2428
}
2529
async function main() {
2630
const { stdout } = await getExecOutput("git", ["rev-parse", "--show-toplevel"]);
@@ -48,4 +52,8 @@ async function main() {
4852
const packages = await findPackages(dirPath);
4953
core.setOutput("packages", packages);
5054
}
51-
await main();
55+
try {
56+
await main();
57+
} catch (error2) {
58+
core.setFailed(error2.message);
59+
}

.github/actions/info/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { getExecOutput } from '@actions/exec';
77
* Recursively locates the packages present in a directory, up to an optional max depth
88
*/
99
async function findPackages(directory: string, maxDepth?: number) {
10+
const output: string[] = [];
1011
async function* recurser(currentDir: string, currentDepth: number): AsyncGenerator<string> {
1112
if (maxDepth !== undefined && currentDepth >= maxDepth) return;
1213

@@ -26,7 +27,11 @@ async function findPackages(directory: string, maxDepth?: number) {
2627
}
2728
}
2829

29-
return Array.fromAsync(recurser(directory, 0));
30+
for await (const each of recurser(directory, 0)) {
31+
output.push(each);
32+
}
33+
34+
return output;
3035
}
3136

3237
async function main() {

.github/actions/info/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"include": ["./index.ts"],
33
"compilerOptions": {
44
"forceConsistentCasingInFileNames": true,
5-
"lib": ["esnext"],
5+
"lib": ["ES2020"],
66
"module": "esnext",
77
"moduleResolution": "bundler",
88
"noEmit": true,
99
"strict": true,
10-
"target": "esnext",
10+
"target": "ES2020",
1111
"verbatimModuleSyntax": true
1212
}
1313
}

0 commit comments

Comments
 (0)