From eed51ed4c3b046b744b6c662d29bacb90a438929 Mon Sep 17 00:00:00 2001 From: Peter Evans <18365890+peter-evans@users.noreply.github.com> Date: Wed, 11 Nov 2020 16:09:35 +0900 Subject: [PATCH] Improve error message for 404 errors --- dist/index.js | 7 ++++++- src/main.ts | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index b1a1aff5..b131b7fd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -60,7 +60,12 @@ function run() { } catch (error) { core.debug(util_1.inspect(error)); - core.setFailed(error.message); + if (error.status == 404) { + core.setFailed('Repository not found, OR token has insufficient permissions.'); + } + else { + core.setFailed(error.message); + } } }); } diff --git a/src/main.ts b/src/main.ts index 2758e3fc..6641def9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -24,7 +24,13 @@ async function run(): Promise { }) } catch (error) { core.debug(inspect(error)) - core.setFailed(error.message) + if (error.status == 404) { + core.setFailed( + 'Repository not found, OR token has insufficient permissions.' + ) + } else { + core.setFailed(error.message) + } } }