Skip to content

Allow Grok reviews to use XAI_API_KEY - #13

Merged
FlyOverCoderKY merged 2 commits into
mainfrom
cursor/grok-api-key-review-ba09
Aug 16, 2026
Merged

FlyOverCoderKY merged 2 commits into
mainfrom
cursor/grok-api-key-review-ba09

Conversation

@FlyOverCoderKY

@FlyOverCoderKY FlyOverCoderKY commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Grok org-wide PR review can now use an API key when XAI_API_KEY is set, while SuperGrok session auth stays as fallback.

What changed

  • Keep skipping drafts (if on the review job is unchanged).
  • Set job-level XAI_API_KEY: ${{ secrets.XAI_API_KEY }}.
  • Before the review action, if env.XAI_API_KEY is non-empty, write ~/.grok/config.toml with env_key = "XAI_API_KEY" only. The key is not written to the file; the step uses a quoted heredoc and does not echo the secret.
  • Step if uses env.XAI_API_KEY != '' (not secrets.*). GitHub does not allow the secrets context in step-level if expressions; that was failing workflow validation.
  • Still pass secrets.GROK_AUTH_JSON. When the API key is present, CLI env_key outranks auth.json. When it is empty, the SuperGrok session keeps working.
  • Keep roast_level: professional, fail_on: never, status_comments: true.
  • Header comment now mentions both secrets.
  • Pin 0xr3ngar/grok-build-review-action to published v1.0.2 (eded30018cdee4e83dfca14d18f292b860c30cdd). Same repo; no permission changes vs v1.0.1 (composite action, no permissions block). The release only forwards model/effort to the CLI.
  • No repo skip-list. No effort / custom_instructions matrix (would be noisy on this org-wide workflow). No AGENTS.md added.

Validation

  • YAML parses; draft-skip if unchanged.
  • Simulated write with a dummy XAI_API_KEY in the environment: config.toml matches the required contents exactly and does not contain the key.
  • Step if no longer references secrets (Codex P1).
  • git diff --check

This PR does not add secrets, merge, or publish. Org owners still need to set XAI_API_KEY themselves if they want API-key auth.

Open in Web Open in Cursor 

Write ~/.grok/config.toml only when the API key secret is set, keep
GROK_AUTH_JSON as fallback, and pin the review action to v1.0.2.

Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bef80c01e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/grok-code-review.yml Resolved
GitHub rejects secrets in step-level if expressions, which blocked
workflow validation. Gate the config write on env.XAI_API_KEY instead.

Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_69ffef1c-5eb9-4006-915e-6febddc14d16)

@github-actions

github-actions Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Grok Grok Build Review — failed

Grok CLI returned an error: Not signed in. To authenticate without a browser, run:
grok login --device-code

Alternatively, set the XAI_API_KEY environment variable or run grok login on a machine with a browser.

Raw output
{"type":"error","message":"Not signed in. To authenticate without a browser, run:\n  grok login --device-code\n\nAlternatively, set the XAI_API_KEY environment variable or run `grok login` on a machine with a browser."}

workflow run

@FlyOverCoderKY
FlyOverCoderKY merged commit 0b02c86 into main Aug 16, 2026
1 of 2 checks passed
@FlyOverCoderKY
FlyOverCoderKY deleted the cursor/grok-api-key-review-ba09 branch August 16, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant