Skip to content

Commit

Permalink
Merge branch 'releases/v2'
Browse files Browse the repository at this point in the history
* releases/v2:
  Check dist on release branches
  Log multiple errors
  • Loading branch information
bigdaz committed Feb 6, 2024
2 parents 83cf5fd + a494d93 commit 24d65a1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
push:
branches:
- main
- releases/**
paths-ignore:
- '**.md'
pull_request:
Expand Down
8 changes: 7 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 6 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ export async function run(): Promise<void> {
}
}
} 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}`)
Expand Down

0 comments on commit 24d65a1

Please sign in to comment.