From 72f58a06cf5db88d3eb982f57de8dbc266e39232 Mon Sep 17 00:00:00 2001 From: peaceiris <30958501+peaceiris@users.noreply.github.com> Date: Sat, 14 Mar 2020 22:09:05 +0000 Subject: [PATCH] fix: property access --- src/main.ts | 8 +++++--- src/utils.ts | 3 --- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index bef9353cf..d11975bed 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,9 +12,8 @@ export async function run(): Promise { const inps: Inputs = getInputs(); showInputs(inps); - const isForkRepository = - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (context.payload as any).repository.fork === 'true'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const isForkRepository = (context.payload as any).repository.fork; const isSkipOnFork = await skipOnFork( isForkRepository, inps.GithubToken, @@ -22,6 +21,9 @@ export async function run(): Promise { inps.PersonalToken ); if (isSkipOnFork) { + core.warning( + 'Action runs on fork and deploy_key or personal_token is empty, Skip deployment' + ); return; } diff --git a/src/utils.ts b/src/utils.ts index e5bb210af..7acae93fc 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -75,9 +75,6 @@ export async function skipOnFork( } if (deployKey === '' && personalToken === '') { - core.warning( - 'Action runs on fork and deploy_key or personal_token is empty' - ); return true; } }