Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/grok-code-review.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Organization-required Grok Build PR review.
# Enforced via org ruleset "Require Grok code review" pointing at this file.
# Secret: org-level GROK_AUTH_JSON (contents of ~/.grok/auth.json after `grok login`).
# Secrets: org-level XAI_API_KEY (preferred; CLI env_key) and GROK_AUTH_JSON
# (fallback; contents of ~/.grok/auth.json after `grok login`).
name: Grok code review

on:
Expand Down Expand Up @@ -30,16 +31,29 @@ jobs:
(github.event_name == 'pull_request' && !github.event.pull_request.draft)
runs-on: ubuntu-latest
timeout-minutes: 30
env:
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
steps:
- name: Checkout PR head
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- 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]
env_key = "XAI_API_KEY"
[models]
default = "grok-build"
EOF

- name: Run Grok Build review
id: grok
uses: 0xr3ngar/grok-build-review-action@331c5b469a19e33d1eda69a0c06efc7d128b625a # v1.0.1
uses: 0xr3ngar/grok-build-review-action@eded30018cdee4e83dfca14d18f292b860c30cdd # v1.0.2
with:
grok_auth_json: ${{ secrets.GROK_AUTH_JSON }}
github_token: ${{ github.token }}
Expand All @@ -60,4 +74,4 @@ jobs:
echo "| Issues | \`${{ steps.grok.outputs.issue_count }}\` |"
echo "| Bugs | \`${{ steps.grok.outputs.bug_count }}\` |"
echo "| Review | ${{ steps.grok.outputs.review_url }}"
} >> "$GITHUB_STEP_SUMMARY"
} >> "$GITHUB_STEP_SUMMARY"
Loading