From e8d140903d23ebbc0604ae4652e2dca2dd627d39 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 16 Aug 2026 19:50:54 +0000 Subject: [PATCH 1/3] Dump SuperGrok and require org XAI_API_KEY for Grok reviews Point grok-build at api.x.ai via config.toml (model, base_url, env_key). Fail closed when XAI_API_KEY is empty. Pass dummy JSON only to satisfy the pinned review action input; do not use session auth. Co-authored-by: Fly Over Coder --- .github/workflows/grok-code-review.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/grok-code-review.yml b/.github/workflows/grok-code-review.yml index ee496b8..4389a1a 100644 --- a/.github/workflows/grok-code-review.yml +++ b/.github/workflows/grok-code-review.yml @@ -1,7 +1,7 @@ # Organization-required Grok Build PR review. # Enforced via org ruleset "Require Grok code review" pointing at this file. -# Secrets: org-level XAI_API_KEY (preferred; CLI env_key) and GROK_AUTH_JSON -# (fallback; contents of ~/.grok/auth.json after `grok login`). +# Auth: org-level XAI_API_KEY only (CLI env_key + https://api.x.ai/v1). +# No SuperGrok session fallback. name: Grok code review on: @@ -40,12 +40,21 @@ jobs: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Require XAI_API_KEY + run: | + if [ -z "${XAI_API_KEY}" ]; then + echo "::error::XAI_API_KEY is empty. Set the org-level XAI_API_KEY secret. This workflow does not fall back to SuperGrok session auth." + exit 1 + fi + - name: Write Grok API key config if: ${{ env.XAI_API_KEY != '' }} run: | mkdir -p "$HOME/.grok" cat > "$HOME/.grok/config.toml" <<'EOF' [model.grok-build] + model = "grok-build" + base_url = "https://api.x.ai/v1" env_key = "XAI_API_KEY" [models] default = "grok-build" @@ -55,7 +64,9 @@ jobs: id: grok uses: 0xr3ngar/grok-build-review-action@eded30018cdee4e83dfca14d18f292b860c30cdd # v1.0.2 with: - grok_auth_json: ${{ secrets.GROK_AUTH_JSON }} + # Action requires this input and writes ~/.grok/auth.json. Dummy JSON + # satisfies the composite; real auth is config.toml + XAI_API_KEY. + grok_auth_json: "{}" github_token: ${{ github.token }} pr_number: ${{ github.event.pull_request.number || github.event.inputs.pr_number }} roast_level: professional From ee6a22a0c65bd4e5f572c62fe34fe2257acb57aa Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 16 Aug 2026 20:01:19 +0000 Subject: [PATCH 2/3] Pin Grok reviews to grok-4.6 on api.x.ai Nathan's API key team does not have grok-build. Set the action model input and config.toml default to grok-4.6. Co-authored-by: Fly Over Coder --- .github/workflows/grok-code-review.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/grok-code-review.yml b/.github/workflows/grok-code-review.yml index 4389a1a..5f48354 100644 --- a/.github/workflows/grok-code-review.yml +++ b/.github/workflows/grok-code-review.yml @@ -52,12 +52,12 @@ jobs: run: | mkdir -p "$HOME/.grok" cat > "$HOME/.grok/config.toml" <<'EOF' - [model.grok-build] - model = "grok-build" + [model.grok-4.6] + model = "grok-4.6" base_url = "https://api.x.ai/v1" env_key = "XAI_API_KEY" [models] - default = "grok-build" + default = "grok-4.6" EOF - name: Run Grok Build review @@ -69,6 +69,7 @@ jobs: grok_auth_json: "{}" github_token: ${{ github.token }} pr_number: ${{ github.event.pull_request.number || github.event.inputs.pr_number }} + model: grok-4.6 roast_level: professional fail_on: never status_comments: "true" From e29736d5296038cfbb59c0f45596088657309e71 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 16 Aug 2026 20:07:14 +0000 Subject: [PATCH 3/3] Quote grok-4.6 TOML table so the model id stays one key Unquoted [model.grok-4.6] nests as model.grok-4.6. Use [model."grok-4.6"] so base_url and env_key attach to grok-4.6. Co-authored-by: Fly Over Coder --- .github/workflows/grok-code-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/grok-code-review.yml b/.github/workflows/grok-code-review.yml index 5f48354..e5175ce 100644 --- a/.github/workflows/grok-code-review.yml +++ b/.github/workflows/grok-code-review.yml @@ -52,7 +52,7 @@ jobs: run: | mkdir -p "$HOME/.grok" cat > "$HOME/.grok/config.toml" <<'EOF' - [model.grok-4.6] + [model."grok-4.6"] model = "grok-4.6" base_url = "https://api.x.ai/v1" env_key = "XAI_API_KEY"