From 3e18d94248c169e5f80c277a6975031c1325f95a Mon Sep 17 00:00:00 2001 From: Chase Busacker Date: Thu, 21 Mar 2024 05:50:17 -0600 Subject: [PATCH] Add an error message with context when sha is empty --- src/main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.ts b/src/main.ts index 13b3350..57b3b3c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -37,6 +37,11 @@ async function run(): Promise { sha: context.sha ?? '' }) + if(github.CONFIG.sha === '') + { + console.error(`Error: Commit sha is an empty string. This action may not be supported in this context. Context: ${context}`) + } + if (UPLOAD_KEY) { const ARTIFACT_RETENTION_DAYS = getInput('ARTIFACT_RETENTION_DAYS') ? parseInt(getInput('RETENTION_DAYS'), 10)