diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index 68f03b5..6b85a10 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -9,6 +9,7 @@ on: push: branches: - main + - releases/** paths-ignore: - '**.md' pull_request: diff --git a/dist/index.js b/dist/index.js index 66c90a7..c30de4f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -28050,7 +28050,13 @@ async function run() { } } catch (error) { - if (error instanceof Error) { + if (error instanceof AggregateError) { + core.setFailed(`Multiple errors returned`); + for (const err of error.errors) { + core.error(`Error ${error.errors.indexOf(err)}: ${err.message}`); + } + } + else if (error instanceof Error) { core.setFailed(error.message); } else { diff --git a/src/main.ts b/src/main.ts index 98096e4..041a3d4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -25,7 +25,12 @@ export async function run(): Promise { } } } catch (error) { - if (error instanceof Error) { + if (error instanceof AggregateError) { + core.setFailed(`Multiple errors returned`) + for (const err of error.errors) { + core.error(`Error ${error.errors.indexOf(err)}: ${err.message}`) + } + } else if (error instanceof Error) { core.setFailed(error.message) } else { core.setFailed(`Unknown object was thrown: ${error}`)