From b7ac44f2301af562e7fe035799dbfcaddfec7eb1 Mon Sep 17 00:00:00 2001 From: UGREEN USER Date: Mon, 2 Nov 2026 16:21:08 -0500 Subject: [PATCH] fix(ssh): emit explicit warning when private-key input is empty (#74) --- dist/index.js | 5 +++++ src/index.ts | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/dist/index.js b/dist/index.js index fe6c47f..031c84d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16163,6 +16163,9 @@ function setFailed(message) { function error(message, properties = {}) { issueCommand("error", toCommandProperties(properties), message instanceof Error ? message.toString() : message); } +function warning(message, properties = {}) { + issueCommand("warning", toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} //#endregion //#region node_modules/zx/build/deno.js if (globalThis.Deno) { @@ -36654,6 +36657,8 @@ async function ssh() { p.stdin.write(privateKey); p.stdin.end(); await p; + } else { + warning("No \"private-key\" input provided (or the referenced GitHub Actions secret is empty). Proceeding without adding an SSH key to ssh-agent."); } const knownHosts = getInput("known-hosts"); if (knownHosts !== "") { diff --git a/src/index.ts b/src/index.ts index 3864887..1f731f9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,6 +44,10 @@ async function ssh(): Promise { p.stdin.write(privateKey) p.stdin.end() await p + } else { + core.warning( + 'No "private-key" input provided (or the referenced GitHub Actions secret is empty). Proceeding without adding an SSH key to ssh-agent.', + ) } const knownHosts = core.getInput('known-hosts')