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/]