diff --git a/.gitea/workflows/codeant.yml b/.gitea/workflows/codeant.yml index 6fe37b6..72e7b3b 100644 --- a/.gitea/workflows/codeant.yml +++ b/.gitea/workflows/codeant.yml @@ -29,8 +29,19 @@ jobs: env: CODEANT_API_TOKEN: ${{ secrets.CODEANT_API_TOKEN }} run: | + if [ -z "${CODEANT_API_TOKEN}" ]; then + echo "ERROR: CODEANT_API_TOKEN secret is not set in repository settings." + echo "Go to: Settings → Secrets → Add Secret → Name: CODEANT_API_TOKEN" + exit 1 + fi mkdir -p $HOME/.codeant - printf '{"apiKey":"%s"}\n' "$CODEANT_API_TOKEN" > $HOME/.codeant/config.json + printf '{"apiKey":"%s","baseUrl":"https://service.codeant.ai"}\n' "$CODEANT_API_TOKEN" > $HOME/.codeant/config.json + echo "Config written (key length: ${#CODEANT_API_TOKEN})" + + - name: Verify CodeAnt connectivity + run: | + echo "Base URL: $(codeant get-base-url)" + echo "CLI version: $(codeant --version)" - name: Debug Commit Info run: | @@ -48,8 +59,9 @@ jobs: - name: Run CodeAnt Review run: | if [ "${GITHUB_EVENT_NAME}" = "pull_request" ] && [ -n "${GITHUB_BASE_REF}" ]; then - codeant review --base "${GITHUB_BASE_REF}" > review.txt || true + echo "Running PR review against base: ${GITHUB_BASE_REF}" + codeant review --base "${GITHUB_BASE_REF}" 2>&1 | tee review.txt || true else - codeant review --last-commit > review.txt || true + echo "Running last-commit review" + codeant review --last-commit 2>&1 | tee review.txt || true fi - cat review.txt