From d204a1f7088c533fdc66b195450cda7c3f16dfb5 Mon Sep 17 00:00:00 2001 From: 108EAA0A Date: Mon, 12 Dec 2022 16:23:56 +0900 Subject: [PATCH] Omit inputs for `workflow_dispatch` event in GitHub Action --- action-src/main.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/action-src/main.ts b/action-src/main.ts index 57d959de1..8a788bc24 100755 --- a/action-src/main.ts +++ b/action-src/main.ts @@ -55,20 +55,10 @@ const getBuildInfo = (event: typeof context) => { }; } case 'workflow_dispatch': { - const { ref, sha } = event.payload.inputs || {}; - - if (!ref || !sha) { - setFailed( - `When triggering via workflow_dispatch, ref & sha are required inputs. See https://github.com/chromaui/action#triggering-from-workflow_dispatch` - ); - return null; - } - return { + sha: event.sha, + branch: event.ref.replace('refs/heads/', ''), slug: event.payload.repository.full_name, - branch: ref.replace('refs/heads/', ''), - ref, - sha, }; } default: {