Back to Blog
Headshot of Danijel Dragiċeviċ

1 minute read

Automating code reviews with OpenAI

Danijel Dragičević

Software Engineer

Our software engineer, Danijel Dragičević, continued his exploration of automating code reviews with OpenAI. He shared his hands-on exploration of this topic in last Friday’s Talk.

He started by explaining that code reviews are essential but often skipped or rushed, and that AI can help maintain code quality and consistency.

At ProductDock, through our #devops-guild initiative, we created a GitHub Action that utilizes OpenAI to automate pull request reviews.

Danijel explained why to use AI for PR reviews:

  1. Solo developers get a reliable second opinion.
  2. It saves time for teams under pressure.
  3. It promotes consistent, objective, and actionable feedback.

Triggered by a pull request, the GitHub Action extracts the code diff and sends it to the OpenAI API with custom prompts. The AI returns feedback, which is automatically posted as a pull request (PR) comment, providing developers with fast, contextual insights right in their workflow.

When it comes to benefits and considerations for all of this, there are, in Danijel’s opinion, four key points: easy integration, privacy is critical, boosts code quality, and it enables faster iteration.

AI-powered pull request reviews enhance development workflows by increasing speed, improving code quality, and ensuring consistent feedback. By combining GitHub Actions with OpenAI, teams can achieve seamless and scalable integration that fits naturally into their existing processes.

As a next step, Danijel suggested exploring the GitHub Marketplace and trying out the “Analyze Pull Request with OpenAI” action to bring intelligent, automated code reviews to your projects.

Discover our blog section for more captivating topics that we’ll be sharing with you soon.

Resources:

Headshot of Danijel Dragiċeviċ

Danijel Dragičević

Software Engineer

Danijel Dragičević is a software developer and content creator who has been part of our family since April 2014. With a strong background in backend development, he has spent the past few years specializing in building robust services for API integrations. Passionate about clean code and efficient workflows, he continuously explores new technologies to enhance development processes.


Related posts.