Tutorials

How to Use the GitHub Plugin to Find Pull Requests Merged Without Review

Did you know that you can find pull requests (PRs) on GitHub that were merged without any review? It might sound surprising, but it happens more often than you think. Unreviewed code could introduce potential risks to your codebase.The good news is that with the GitHub integration, you can easily identify these PRs by running a straightforward query.

In this guide, we’ll show you how to build a simple query using CloudQuery’s GitHub integration to identify these unreviewed PRs. Why does it matter? Reviews catch bugs, align contributors, and improve the overall quality of your code. By finding and addressing unreviewed merges, you can ensure a higher standard of code integrity across your repositories.

Getting Started with CloudQuery and Syncing GitHub Data

If you're new to CloudQuery, simply head over to the Downloads page to install the CloudQuery CLI and get up and running. Once you're set, you can sync your GitHub data using the CloudQuery GitHub integration. This integration pulls all your essential GitHub data—issues, pull requests, reviews, and more—into your database. After syncing, you'll be able to run insightful queries like the one we’ve discussed to uncover valuable information about your repositories.

The Search for Merges Without Reviews

Pull requests are central to collaboration on GitHub, but sometimes they get merged without a thorough review. Why does this matter? Reviews help catch bugs, provide constructive feedback, and confirm that all contributors are aligned before the code gets integrated into the main branch. When a PR bypasses this essential process, it can introduce hidden issues into the codebase.

How to Find These PRs

Let’s get practical. Here’s a query that you can run to find PRs that were merged without any review:

SELECT
i.repository_id,
i.updated_at,
i.id,
i.number,
i.state,
i.title,
(i.pull_request->>'merged_at') AS merged_at,
(i.user->>'login') AS user
FROM github_issues i
LEFT JOIN github_issue_pullrequest_reviews r
ON i._cq_id = r._cq_parent_id
WHERE r._cq_parent_id IS NULL
AND i.is_pull_request IS TRUE
AND i.state = 'closed'
AND (i.pull_request->>'merged_at') IS NOT NULL;
repository_idupdated_atidnumberstatetitlemerged_atuser
6686139402024-08-12 17:36:2924615565241022closedchore: Ignore non existing macro directories2024-08-12T17:36:26Zuser1
6686139402024-07-11 09:26:552401235038972closedchore: Switch to googleapis/release-please-action2024-07-11T09:26:53Zuser1
6686139402024-05-02 12:17:312275389166833closedFeat: Added IAM Macros Athena2024-05-02T12:17:30Zuser2

This query checks for all closed pull requests that have been merged but didn't have any associated reviews. The LEFT JOIN ensures we grab those PRs without a corresponding review in github_issue_pullrequest_reviews. We’re pulling in details like the repository ID, the time it was updated, the PR number, and of course, the author.

What Tables Are We Using?

We’re working with two main tables here:

  • github_issues: This table holds the issue and pull request data, like the title, state, and author of each PR.
  • github_issue_pullrequest_reviews: This table logs the reviews for PRs. We’re using a LEFT JOIN to make sure we grab the PRs that don’t have any reviews associated with them.

Summary

Finding pull requests that were merged without review could save you from potential headaches down the line. By running the query above, you can quickly identify and address those unreviewed merges. Whether it's tightening up the review process or just making sure nothing critical was missed, this is an easy way to boost the quality of your codebase.

Ready to dive deeper into your GitHub data? Try CloudQuery today and gain powerful insights into your repos. If you’ve got questions or want to chat with the team, reach out to us or join our community to connect with other users and engineers.

Try CloudQuery yourself

Self-hosted, open source, and free to start. Or schedule a demo to see the managed version.

Related posts

Tutorials

How to Automatically Update CloudQuery Integrations with Renovate

Configure Renovate to automatically update CloudQuery integration versions in your YAML files using the CloudQuery Hub API as a custom datasource.

Matthew M

Matthew M

May 20, 2026

AWS

Security

Tutorials

Finding AWS Unrestricted Outbound Access in 2026: EC2, Lambda, and Beyond

Find EC2, Lambda, and ECS Fargate resources with unrestricted outbound access in AWS using SQL. Why egress controls still break attack chains in 2026.

Joe Karlsson

Joe Karlsson

May 5, 2026

AWS

Security

Tutorials

AWS IAM Identity Center with Google Workspace as an IdP: 2026 Step-by-Step Guide

Set up AWS IAM Identity Center with Google Workspace: SAML authentication, SCIM user provisioning, and group sync with CLI or ssosync. Updated for 2026.

Joe Karlsson

Joe Karlsson

May 5, 2026

GCP

Security

Tutorials

Creating Cross-Project Service Accounts in GCP (Console + gcloud CLI)

Create a GCP service account that reads across all your projects with one credential. Covers gcloud CLI, org-level vs.

Joe Karlsson

Joe Karlsson

May 5, 2026

AWS

Cloud Infrastructure

Security

Tutorials

Integrate AbuseIPDB Threat Intelligence with CloudQuery

Enrich your cloud asset inventory with AbuseIPDB threat intelligence to identify public cloud IPs with known abuse reports.

Joe Karlsson

Joe Karlsson

April 20, 2026

AWS

Cloud Infrastructure

Tutorials

How to Query ipinfo.io Data with CloudQuery

Learn how to enrich your cloud asset inventory with ipinfo.io IP geolocation and threat intelligence data using CloudQuery.

Joe Karlsson

Joe Karlsson

April 20, 2026

AWS

Security

Tutorials

AWS IAM Identity Center (Formerly AWS SSO): The Complete 2026 Guide

AWS IAM Identity Center replaced AWS SSO in 2022. Learn how to set it up, configure permission sets, use the AWS CLI, and audit access with CloudQuery.

Joe Karlsson

Joe Karlsson

April 6, 2026

AWS

Tutorials

AWS Pinpoint Is Being Deprecated: How to Assess Your Migration Scope

AWS Pinpoint reaches end of support October 2026. Query your Pinpoint usage across all accounts to find what needs migrating before the deadline.

Joe Karlsson

Joe Karlsson

March 24, 2026

Tutorials

Moving Data from PostgreSQL to MotherDuck

How to sync PostgreSQL data to MotherDuck using CloudQuery, with both one-off batch and continuous CDC streaming options for serverless analytics.

Herman Schaaf

Herman Schaaf

March 13, 2026

Own your pipeline.
Own your data.