Skip to content

Commit cebfeb7

Browse files
committed
Figure out what went wrong with the info action
1 parent 785a0e4 commit cebfeb7

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/actions/src/info/index.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs from 'fs/promises';
22
import pathlib from 'path';
3+
import utils from 'util';
34
import * as core from '@actions/core';
45
import { getExecOutput } from '@actions/exec';
56

@@ -98,7 +99,17 @@ async function findPackages(directory: string, maxDepth?: number) {
9899
if (item.name === 'package.json') {
99100
try {
100101
return await getPackageInfo(currentDir);
101-
} catch {}
102+
} catch (error) {
103+
if (!utils.types.isNativeError(error)) {
104+
core.error(`Unknown error occurred ${error}`);
105+
throw error;
106+
}
107+
108+
if ('code' in error && error.code !== 'ERR_MODULE_NOT_FOUND') {
109+
core.error(error);
110+
throw error;
111+
}
112+
}
102113
}
103114
continue;
104115
}
@@ -118,7 +129,6 @@ async function findPackages(directory: string, maxDepth?: number) {
118129
}
119130

120131
async function runForAllPackages(gitRoot: string) {
121-
122132
const results = await Promise.all(
123133
Object.entries({
124134
libs: pathlib.join(gitRoot, 'lib'),

0 commit comments

Comments
 (0)