@@ -58,10 +58,21 @@ type tailscaleStatus = {
5858
5959// Cross-platform Tailscale local API status check
6060async function getTailscaleStatus ( ) : Promise < tailscaleStatus > {
61- const { stdout } = await exec . getExecOutput ( cmdTailscale , [
62- "status" ,
63- "--json" ,
64- ] ) ;
61+ const { exitCode, stdout, stderr } = await exec . getExecOutput (
62+ cmdTailscale ,
63+ [ "status" , "--json" ] ,
64+ {
65+ silent : true ,
66+ ignoreReturnCode : true ,
67+ }
68+ ) ;
69+ if ( exitCode !== 0 ) {
70+ process . stderr . write ( stderr ) ;
71+ throw new Error ( `tailscale status failed with exit code ${ exitCode } ` ) ;
72+ }
73+ if ( core . isDebug ( ) ) {
74+ process . stdout . write ( stdout ) ;
75+ }
6576 return JSON . parse ( stdout ) ;
6677}
6778
@@ -110,7 +121,6 @@ async function run(): Promise<void> {
110121 // Check Tailscale status (cross-platform)
111122 try {
112123 const status = await getTailscaleStatus ( ) ;
113- core . debug ( `Tailscale status: ${ JSON . stringify ( status ) } ` ) ;
114124 if ( status . BackendState === "Running" ) {
115125 core . info ( "✅ Tailscale is running and connected!" ) ;
116126 if ( runnerOS === runnerMacOS ) {
@@ -574,6 +584,7 @@ async function waitForDaemonReady(): Promise<void> {
574584
575585 core . info ( "Waiting for tailscaled daemon to become ready..." ) ;
576586
587+ var lastErr : any ;
577588 while ( waited < maxWaitMs ) {
578589 try {
579590 const status = await getTailscaleStatus ( ) ;
@@ -586,13 +597,16 @@ async function waitForDaemonReady(): Promise<void> {
586597 }
587598 } catch ( err ) {
588599 // Daemon not ready yet, keep polling
600+ lastErr = err ;
589601 core . debug ( `Waiting for daemon... (${ waited } ms elapsed)` ) ;
590602 }
591603 await sleep ( pollIntervalMs ) ;
592604 waited += pollIntervalMs ;
593605 }
594606
595- throw new Error ( "tailscaled daemon did not become ready within timeout" ) ;
607+ throw new Error (
608+ `tailscaled daemon did not become ready within timeout, last error: ${ lastErr } `
609+ ) ;
596610}
597611
598612async function connectToTailscale (
0 commit comments