Files
ghbot/.env.example
lezi-fun 9e47ab339e feat: sync ghbot-Nodeloc v1.2.0 capabilities into upstream
Merges all 33 commits from lza6/ghbot-Nodeloc (v1.0.0 through v1.2.0)
while keeping both sides' features in every conflicted file:

- EventRouter dispatch extracted from runReview.ts (7.1), with the
  runtime environment block preserved on the review-start comment
- Unified command ack messages (6.3) combined with the collapsed
  runtime environment block and bot signature on /recheck replies
- Status banner and collapsible unposted findings in review bodies (6.1)
- Centralized runtime directories behind GHBOT_RUNTIME_DIR (D-13);
  webhook knowledge cache now lives under tempRootDirectory()
- Production hardening for merge races, timeouts, webhook ops;
  atomic temp-file rename for R2 cache restores kept from upstream
- Webhook parity retained: triage events gated by WEBHOOK_TRIAGE_ENABLED,
  read-only command guidance, repository knowledge injection,
  runtime environment block on webhook chat replies
- Sanitization/secret redaction centralization, error-aware retry,
  duplicate merge prevention, in-process webhook retries, /metrics
- Infra: eslint/prettier gates with CI verify workflow, docs archives

typecheck, eslint, prettier format:check, and 164 tests all pass.
2026-08-24 11:47:28 +08:00

75 lines
2.7 KiB
Bash

PORT=3000
# Optional structured logging level (trace/debug/info/warn/error/fatal).
LOG_LEVEL=info
# Optional runtime root for writable scratch/cache storage. Empty means the process working directory.
GHBOT_RUNTIME_DIR=
# Optional in GitHub Actions because github.token is injected automatically.
# Still useful for local simulation and as a GitHub App fallback.
GITHUB_TOKEN=ghp_your_token_here
GH_APP_ID=
GH_APP_PRIVATE_KEY=
GH_APP_INSTALLATION_ID=
# Optional GitHub App webhook chat mode. Action mode remains the default and
# does not require these values. Set WEBHOOK_ENABLED=true only for a separate
# long-running Node/Docker webhook service.
WEBHOOK_ENABLED=false
WEBHOOK_SECRET=
WEBHOOK_PATH=/webhooks/github
# anyone | read | write. In "read" mode, organization members can also ask on
# organization-owned repositories; personal repositories still use collaborator access.
WEBHOOK_CHAT_PERMISSION=read
WEBHOOK_QUEUE_CONCURRENCY=2
WEBHOOK_QUEUE_LIMIT=500
# Automatic issue/PR triage (labels + duplicate detection) in webhook mode.
WEBHOOK_TRIAGE_ENABLED=true
# GitHub App login or slug used in @mentions, e.g. forumlify[bot].
BOT_NAME=ghbot
# goose uses this OpenAI-compatible Chat Completions endpoint.
GOOSE_API_KEY=sk-...
GOOSE_BASE_URL=https://api.openai.com/v1
GOOSE_MODEL=gpt-5.4
GOOSE_THINKING_EFFORT=high
# Optional: the pinned goose CLI version, shown in the runtime environment block.
# GOOSE_VERSION=v1.46.0
# Deprecated fallback aliases still accepted by config and workflows:
# OPENCODE_API_KEY, OPENCODE_BASE_URL, OPENCODE_MODEL, OPENCODE_REASONING_EFFORT
# allow | require_approval | reject. Ordinary review notes pass by default.
REVIEW_POLICY=allow
# normal | strict. Only strict enables the thorough review prompt.
REVIEW_STRICTNESS=normal
# Optional repository-specific review rules.
REVIEW_INSTRUCTIONS=
# Comma-separated PR base-branch globs. Empty means all base branches.
REVIEW_BRANCHES=
# Persist repository knowledge in the configured private cache. Authorized @bot agents
# can improve it only when write is explicitly enabled.
REPOSITORY_KNOWLEDGE_ENABLED=true
REPOSITORY_KNOWLEDGE_WRITE=false
# Optional Cloudflare R2 persistent storage. Configure all credential values
# together. R2_PREFIX is an optional safe object-key namespace.
R2_ENDPOINT=https://ACCOUNT_ID.r2.cloudflarestorage.com
R2_BUCKET_NAME=ghbot-cache
R2_PREFIX=
R2_ACCESS_KEY_ID=
R2_SECRET_ACCESS_KEY=
TRIAGE_ENABLED=true
TRIAGE_LABELS=bug,enhancement,documentation,question,maintenance
TRIAGE_DUPLICATE_LABEL=duplicate
TRIAGE_CANDIDATE_LIMIT=50
TRIAGE_INSTRUCTIONS=
AUTO_MERGE=false
AUTO_RESOLVE_CONFLICTS=false
# Optional trusted shell command run after AI conflict resolution and before push.
CONFLICT_TEST_COMMAND=
MERGE_METHOD=squash
REQUIRE_CHECKS=true
MAX_PATCH_CHARS=120000