GitHub Actions
Tabnine use is limited to one user per seat under the license agreement. If you want to use Tabnine in a CI/CD pipeline, please contact our team.
Run Tabnine CLI on every GitHub pull request to automate code review, documentation, test generation, and more.
Overview
The Tabnine GitHub Action is a composite action that installs the Tabnine CLI, authenticates, and runs the agent in non-interactive mode on every pull request. The included configuration provides a comprehensive code review prompt, but you can customize the prompt to automate any task — documentation generation, test scaffolding, changelog drafting, and more.
Composite Action vs. Standalone Workflow
There are two ways to use Tabnine with GitHub Actions:
Composite Action (recommended)
Most users - minimal setup, automatic updates when you bump the action version
Standalone Workflow
Users who want full control over every step, need to customize the setup, or prefer not to depend on an external action
The Quick Setup below uses the composite action. If you prefer the standalone approach, copy GitHub/tabnine-review.yml from this repository into your project at .github/workflows/tabnine-review.yml. The standalone workflow contains all the same steps (CLI installation, authentication, cleanup, and the code review prompt) inlined directly, so you can modify any part of it.
Prerequisites
A GitHub repository with Actions enabled
A Tabnine account with Agents enabled
TABNINE_KEY- Tabnine Personal access token
Quick Setup
Add the TABNINE_KEY secret
Go to your repository's Settings > Secrets and variables > Actions and add a new repository secret named TABNINE_KEY with your Tabnine PAT.
Create the workflow file
Create .github/workflows/tabnine-review.yml in your repository:
Open a pull request
Push the workflow file and open a PR. The Tabnine Code Review will run automatically and post its findings as comments.
Configuration
Required Inputs
TABNINE_KEY
Tabnine Personal access token. Store as a repository secret.
github_token
GitHub token for posting comments. Use the built-in secrets.GITHUB_TOKEN.
repository
Repository in owner/repo format. Use ${{ github.repository }}.
pull_request_number
PR number. Use ${{ github.event.pull_request.number }}.
head_sha
PR head commit SHA. Use ${{ github.event.pull_request.head.sha }}.
base_sha
PR base commit SHA. Use ${{ github.event.pull_request.base.sha }}.
Optional Inputs
tabnine_host
https://console.tabnine.com
Tabnine host URL (for self-hosted / EMT installations)
model_id
—
Model ID for the AI agent. Overrides the default from the admin console.
Important Notes
Full git history required. The checkout step must use fetch-depth: 0 so the agent can access the full diff between the PR branch and the base branch.
Permissions
The workflow requires these GitHub token permissions:
contents
read
Read repository files and diff
pull-requests
write
Post review comments on the PR
How It Works
Install the CLI
Installs Tabnine CLI from your Tabnine host.
Configure authentication
Configures authentication using the TABNINE_KEY secret.
Clean up previous comments
Cleans up any previous Tabnine PR Bot comments (to avoid duplicates on re-runs).
Run the agent
Runs the agent with the configured prompt — the agent has access to the repository, the PR diff (via gh pr diff), shell commands, and the GitHub API.
The agent uses the pre-authenticated gh CLI, so no additional API tokens are needed beyond GITHUB_TOKEN.
With the included code review prompt, the agent fetches the diff, classifies risk, audits the code, and posts inline comments and a summary. You can replace or extend the prompt to perform other tasks.
Customization
Reviewing Only Specific Branches
Update the on trigger to limit which branches get reviewed:
Using a Specific Model
Pass a model_id to override the default AI model:
Self-Hosted / Private Installations
If you run a self-hosted Tabnine instance, set the tabnine_host input:
Troubleshooting
See Also
Git Integrations Overview — Supported platforms and review capabilities
GitLab CI/CD — Setup for GitLab
Bitbucket Pipelines — Setup for Bitbucket
Last updated
Was this helpful?
