ci: show bootstrap auth error response for debugging
Some checks failed
CI/CD / publish-rpm (push) Blocked by required conditions
CI/CD / lint (push) Successful in 48s
CI/CD / test (push) Successful in 1m1s
CI/CD / typecheck (push) Successful in 2m11s
CI/CD / smoke (push) Failing after 1m0s
CI/CD / build (push) Has been cancelled

The curl -sf flag was hiding the actual HTTP error body. Now we capture
and display the full response to diagnose why auth bootstrap fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Michal
2026-03-09 17:20:34 +00:00
parent a5ac0859fb
commit 3cd6a6a17d

View File

@@ -144,12 +144,18 @@ jobs:
- name: Bootstrap auth and write credentials - name: Bootstrap auth and write credentials
run: | run: |
RESULT=$(curl -sf -X POST http://localhost:3100/api/v1/auth/bootstrap \ RESULT=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X POST http://localhost:3100/api/v1/auth/bootstrap \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d '{"email":"ci@test.local","password":"ci-smoke-test"}') -d '{"email":"ci@test.local","password":"ci-smoke-test"}')
echo "Auth bootstrapped" HTTP_CODE=$(echo "$RESULT" | tail -1 | sed 's/HTTP_STATUS://')
BODY=$(echo "$RESULT" | sed '$d')
echo "Bootstrap response (HTTP $HTTP_CODE): $BODY"
if [ "$HTTP_CODE" -ge 400 ]; then
echo "::error::Bootstrap failed with HTTP $HTTP_CODE"
exit 1
fi
mkdir -p ~/.mcpctl mkdir -p ~/.mcpctl
echo "$RESULT" | node -e " echo "$BODY" | node -e "
const res = JSON.parse(require('fs').readFileSync('/dev/stdin','utf-8')); const res = JSON.parse(require('fs').readFileSync('/dev/stdin','utf-8'));
const creds = {token: res.token, mcpdUrl: 'http://localhost:3100', user: 'ci@test.local'}; const creds = {token: res.token, mcpdUrl: 'http://localhost:3100', user: 'ci@test.local'};
require('fs').writeFileSync(require('os').homedir()+'/.mcpctl/credentials', JSON.stringify(creds)); require('fs').writeFileSync(require('os').homedir()+'/.mcpctl/credentials', JSON.stringify(creds));