name: "Wait for Toolshed" description: "Poll the toolshed /_health endpoint until it returns 200, so tests never race a not-yet-bound server." inputs: url: description: "Base toolshed URL, no trailing slash (the action appends /_health)." default: "http://localhost:8000" timeout: description: "Maximum seconds to wait for the server to become ready." default: "60" runs: using: "composite" steps: # Mirrors scripts/start-local-dev.sh `wait_for_http`: poll /_health until 200 # so the test step starts against a bound server instead of hard-failing on a # `Connection refused` race (CT-1738). - name: ⏳ Wait for Toolshed to be ready shell: bash run: | url="${{ inputs.url }}/_health" deadline=$(( SECONDS + ${{ inputs.timeout }} )) echo "Waiting for toolshed at $url ..." while (( SECONDS < deadline )); do status=$(curl -s -o /dev/null -w "%{http_code}" --max-time 2 "$url" 2>/dev/null || true) if [[ "$status" == "200" ]]; then echo " toolshed is ready." exit 0 fi sleep 1 done echo "::error::toolshed did not become ready at $url within ${{ inputs.timeout }}s" exit 1