Skip to content

Commit 66f39e1

Browse files
committed
Published using @Stream44 Studio
Signed-off-by: Christoph <christoph@christoph.diy>
1 parent 790b616 commit 66f39e1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/key.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,16 @@ export function addKeyToAgent(privateKeyPath: string): boolean {
158158
/**
159159
* Ensure a key is loaded in the ssh-agent. Adds it if not already present.
160160
* Logs status messages using chalk.
161+
* Skips adding to agent in non-TTY mode (e.g., CI environments).
161162
*/
162163
export async function ensureKeyInAgent(privateKeyPath: string, keyName: string, keyLabel: string): Promise<void> {
163164
const chalk = (await import('chalk')).default
164165

166+
// Skip ssh-agent operations in non-TTY mode (CI, scripts, etc.)
167+
if (!process.stdin.isTTY || process.env.CI) {
168+
return
169+
}
170+
165171
if (isKeyInAgent(privateKeyPath)) {
166172
return
167173
}

0 commit comments

Comments
 (0)