Description
๐ค Automate GitLab Code Reviews using GPT-4
Get instant AI-powered feedback on GitLab Merge Requests โ just comment +0 and let GPT-4 handle the review!
โ Stop wasting time manually reading every file change โ this workflow listens to GitLab comments, fetches diffs, analyzes them with GPT-4, and posts intelligent feedback directly in your PR discussion.
๐ง What Problem Does It Solve?
Manual code reviews can be slow, biased, or inconsistent
This AI-enhanced workflow ensures every PR gets
โ Instant review upon trigger comment
๐ง Smart feedback using GPT-4
๐ Continuous feedback loop via comments
๐ Focus on relevant code changes only
โ๏ธ How It Works
๐ฉ Listens to GitLab PR comments (e.g., +0) via webhook
๐ Filters comments using your custom trigger words
๐ Fetches file changes from the PR using GitLab API
๐ฆ Splits and filters the file changes intelligently
๐งช Extracts and parses the last diff line for context
๐ง Sends code changes to GPT-4 using custom prompt
๐ Posts the AIโs review back to the GitLab PR discussion
โจ Key Features
๐ฌ Trigger reviews with a simple comment (+0, customizable)
๐ Works with your GitLab repo URL and token
๐ง Powered by OpenAI ChatGPT (GPT-4)
๐งฉ Fully editable prompts โ tailor GPT feedback to your project style
๐ Responds instantly within the PR discussion
๐ Skips unwanted files and comments automatically
๐ง What You Need
โ GitLab project with Merge Requests enabled
โ GitLab Access Token with read/write privileges
โ GitLab webhook for note_events (for PR comments)
โ OpenAI API key for GPT-4 access
โ n8n instance to run the workflow
๐ ๏ธ Setup Instructions
๐งท Add GitLab webhook to trigger on note_events
๐ Insert your GitLab URL and Access Token in workflow nodes
โ๏ธ Customize the trigger word (default is +0)
๐ฌ Define your preferred GPT prompt for reviews
๐ค Connect OpenAI GPT-4 node with your API key
๐งช Test with sample PR before scaling
๐ Integrations
GitLab
OpenAI GPT-4
n8n Core Nodes
Project Link:-[https://preview--gitlab-gpt-review-bot.lovable.app/]











