From 087b0cd6d8f8164bc3856398032f0f0babde1547 Mon Sep 17 00:00:00 2001 From: Jonas Lomholdt Date: Mon, 17 Oct 2022 10:06:15 +0200 Subject: [PATCH 1/2] Fix build error --- src/main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index cf9ab38..c8bbb5f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -26,7 +26,11 @@ async function run() { ); console.log(`Replaced tokens in files: ${result}`); } catch (error) { - core.setFailed(error.message); + if (error instanceof Error) { + core.setFailed(error.message); + } else { + core.setFailed(String(error)); + } } } From 9395e174d631432dcc68981e3d0d36a4d9cfe143 Mon Sep 17 00:00:00 2001 From: Jonas Lomholdt Date: Mon, 17 Oct 2022 10:21:02 +0200 Subject: [PATCH 2/2] handle unknown type --- src/main.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index c8bbb5f..8ba0119 100644 --- a/src/main.ts +++ b/src/main.ts @@ -26,11 +26,7 @@ async function run() { ); console.log(`Replaced tokens in files: ${result}`); } catch (error) { - if (error instanceof Error) { - core.setFailed(error.message); - } else { - core.setFailed(String(error)); - } + if (error instanceof Error) core.setFailed(error.message); } }