From af3536bc171fecfaffe935b00f4c474b124ad695 Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Sat, 24 Jan 2026 20:04:28 -0800 Subject: [PATCH] Simplify indri IP extraction from tailscale status Use simple grep and awk to parse plain text tailscale status output instead of trying to parse JSON. Also show the status output for debugging. Co-Authored-By: Claude Opus 4.5 --- .forgejo/actions/build-push-image/action.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.forgejo/actions/build-push-image/action.yaml b/.forgejo/actions/build-push-image/action.yaml index 73782c7..083fb99 100644 --- a/.forgejo/actions/build-push-image/action.yaml +++ b/.forgejo/actions/build-push-image/action.yaml @@ -106,15 +106,13 @@ runs: # Get indri's Tailscale IP from tailscale status (registry runs on indri) echo "Getting indri's Tailscale IP..." - INDRI_IP=$(docker exec ts-ci-gateway tailscale status --json | grep -o '"indri"[^}]*' | grep -o '"TailscaleIPs":\[[^]]*' | grep -o '100\.[0-9.]*' | head -1) - if [ -z "$INDRI_IP" ]; then - echo "Trying alternative method..." - INDRI_IP=$(docker exec ts-ci-gateway tailscale status | grep indri | awk '{print $1}') - fi + echo "Tailscale status:" + docker exec ts-ci-gateway tailscale status || true + + INDRI_IP=$(docker exec ts-ci-gateway tailscale status 2>/dev/null | grep -E '\bindri\b' | awk '{print $1}') if [ -z "$INDRI_IP" ]; then - echo "ERROR: Could not get indri's Tailscale IP" - docker exec ts-ci-gateway tailscale status + echo "ERROR: Could not get indri's Tailscale IP from tailscale status" exit 1 fi echo "Indri Tailscale IP: $INDRI_IP"