Skip to content

Commit 2cf9718

Browse files
Add Tabnine code review workflow
1 parent afa22d1 commit 2cf9718

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

.github/workflows/tabnine_cr.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Tabnine Code Review
2+
on:
3+
pull_request
4+
5+
jobs:
6+
code-review:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
ref: ${{ github.event.pull_request.head.sha }}
17+
18+
- name: Install Tabnine CLI
19+
run: |
20+
export TABNINE_HOST=https://console.tabnine.com
21+
curl $TABNINE_HOST/update/cli/installer.mjs | node - $TABNINE_HOST
22+
23+
- name: Configure git
24+
run: |
25+
git config user.name "Tabnine CLI Agent"
26+
git config user.email "TabnineCLI@tabnine.com"
27+
28+
- name: Configure tabnine auth
29+
run: |
30+
mkdir -p ~/.tabnine/agent
31+
echo ${{ secrets.TABNINE_KEY }} > ~/.tabnine/agent/tabnine_creds.json
32+
33+
- name: Code Review
34+
env:
35+
GH_TOKEN: ${{ github.token }}
36+
BRANCH_PREFIX: docs
37+
run: |
38+
tabnine -y -p "You are operating in a GitHub Actions runner performing automated code review. The gh CLI is available and authenticated via GH_TOKEN. You may comment on pull requests.
39+
Context:
40+
- Repo: ${{ github.repository }}
41+
- PR Number: ${{ github.event.pull_request.number }}
42+
- PR Head SHA: ${{ github.event.pull_request.head.sha }}
43+
- PR Base SHA: ${{ github.event.pull_request.base.sha }}
44+
Objectives:
45+
1) Re-check existing review comments and reply resolved when addressed
46+
2) Review the current PR diff and flag only clear, high-severity issues
47+
3) Leave very short inline comments (1-2 sentences) on changed lines only and a brief summary at the end
48+
Procedure:
49+
- Get existing comments: gh pr view --json comments
50+
- Get diff: gh pr diff
51+
- If a previously reported issue appears fixed by nearby changes, reply: ✅ This issue appears to be resolved by the recent changes
52+
- Avoid duplicates: skip if similar feedback already exists on or near the same lines
53+
Commenting rules:
54+
- Max 10 inline comments total; prioritize the most critical issues
55+
- One issue per comment; place on the exact changed line
56+
- Natural tone, specific and actionable; do not mention automated or high-confidence
57+
- Use emojis: 🚨 Critical 🔒 Security ⚡ Performance ⚠️ Logic ✅ Resolved ✨ Improvement
58+
Submission:
59+
- Submit one review containing inline comments plus a concise summary
60+
- Use only: gh pr review --comment
61+
- Do not use: gh pr review --approve or --request-changes"

0 commit comments

Comments
 (0)