cd77158577
Allows specifying internal routing addresses for Gitea/GitHub API calls (e.g., http://server:3000), addressing container network restrictions when external URLs are not routable.
32 lines
1.5 KiB
Bash
Executable File
32 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# ─── Entrypoint for Docker action ────────────────────────────────────────────
|
|
# Docker actions receive inputs as INPUT_<NAME> env vars.
|
|
# We map them to PI_* vars that review.sh expects, then run the review.
|
|
# ──────────────────────────────────────────────────────────────────────────────
|
|
|
|
# Map Docker action inputs to review.sh env vars
|
|
export PI_API_KEY="${INPUT_API_KEY}"
|
|
export PI_PROVIDER="${INPUT_PROVIDER:-zai}"
|
|
export PI_MODEL="${INPUT_MODEL:-glm-5.1}"
|
|
export PI_BASE_URL="${INPUT_BASE_URL:-}"
|
|
export PI_SERVER_URL="${INPUT_SERVER_URL:-}"
|
|
export PI_TOOLS="${INPUT_TOOLS:-read,grep,find,ls}"
|
|
export PI_REVIEW_PROMPT="${INPUT_REVIEW_PROMPT:-}"
|
|
export PI_EXCLUDE="${INPUT_EXCLUDE_PATTERNS:-*.lock package-lock.json yarn.lock pnpm-lock.yaml *.min.js *.min.css *.map}"
|
|
export PI_MAX_DIFF="${INPUT_MAX_DIFF_BYTES:-80000}"
|
|
export PI_TOKEN="${INPUT_TOKEN}"
|
|
export PI_DEBUG="${INPUT_DEBUG:-false}"
|
|
|
|
# The calling repo is mounted at GITHUB_WORKSPACE by both GitHub and Gitea.
|
|
# cd into it so git commands work against the right repo.
|
|
cd "${GITHUB_WORKSPACE:-/github/workspace}"
|
|
|
|
echo "Workspace: $(pwd)"
|
|
echo "Provider: ${PI_PROVIDER}"
|
|
echo "Model: ${PI_MODEL}"
|
|
|
|
# Run the review
|
|
bash /action/scripts/review.sh
|