From 07e2b760664f080c40eec4eacf7477256582db36 Mon Sep 17 00:00:00 2001 From: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Date: Fri, 10 Apr 2026 23:42:53 -0700 Subject: [PATCH] fix: improve error message when app identifier is empty (#362) When `client-id` (or the deprecated `app-id`) resolves to an empty string, for example because a secret or variable is not available in the workflow context, the error message from `@octokit/auth-app` is not very helpful: ``` [@octokit/auth-app] appId option is required ``` A validation check was added recently to catch this earlier, but its message could be more informative: ``` Either 'client-id' or 'app-id' input must be set ``` This updates the message to clarify that the value resolved to empty and nudges users toward checking their secret or variable availability: ``` The 'client-id' input must be set to a non-empty string. If using a secret or variable, ensure it is available in this workflow context. ``` Closes #249 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- dist/main.cjs | 2 +- main.js | 2 +- tests/index.js.snapshot | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/main.cjs b/dist/main.cjs index c7cf562..b9dc621 100644 --- a/dist/main.cjs +++ b/dist/main.cjs @@ -23352,7 +23352,7 @@ async function run() { ensureNativeProxySupport(); const clientId = getInput("client-id") || getInput("app-id"); if (!clientId) { - throw new Error("Either 'client-id' or 'app-id' input must be set"); + throw new Error("The 'client-id' (or deprecated 'app-id') input must be set to a non-empty string. If using a secret or variable, ensure it is available in this workflow context."); } const privateKey = getInput("private-key"); const owner = getInput("owner"); diff --git a/main.js b/main.js index b685126..32696dd 100644 --- a/main.js +++ b/main.js @@ -20,7 +20,7 @@ async function run() { const clientId = core.getInput("client-id") || core.getInput("app-id"); if (!clientId) { - throw new Error("Either 'client-id' or 'app-id' input must be set"); + throw new Error("The 'client-id' (or deprecated 'app-id') input must be set to a non-empty string. If using a secret or variable, ensure it is available in this workflow context."); } const privateKey = core.getInput("private-key"); const owner = core.getInput("owner"); diff --git a/tests/index.js.snapshot b/tests/index.js.snapshot index d5d5f9b..4789f44 100644 --- a/tests/index.js.snapshot +++ b/tests/index.js.snapshot @@ -56,11 +56,11 @@ POST /api/v3/app/installations/123456/access_tokens `; exports[`main-missing-client-and-app-id.test.js > stderr 1`] = ` -Either 'client-id' or 'app-id' input must be set +The 'client-id' (or deprecated 'app-id') input must be set to a non-empty string. If using a secret or variable, ensure it is available in this workflow context. `; exports[`main-missing-client-and-app-id.test.js > stdout 1`] = ` -::error::Either 'client-id' or 'app-id' input must be set +::error::The 'client-id' (or deprecated 'app-id') input must be set to a non-empty string. If using a secret or variable, ensure it is available in this workflow context. `; exports[`main-missing-owner.test.js > stderr 1`] = `