Table: github_pull_request_comment - Query GitHub Pull Request Comments using SQL
GitHub Pull Request Comments are individual responses or feedbacks given on a pull request in a GitHub repository. These comments facilitate discussions on proposed changes in the codebase, allowing for collaborative decision-making and code review. They represent an integral part of the code review process in GitHub, fostering effective communication and quality control among contributors.
Table Usage Guide
The github_pull_request_comment
table provides insights into the comments made on pull requests within a GitHub repository. As a developer or project manager, explore comment-specific details through this table, including the comment content, author, creation date, and associated metadata. Utilize it to understand the discussions and feedback on pull requests, facilitating effective code reviews and collaborative decision-making.
Important Notes
- You must specify the
repository_full_name
(repository including org/user prefix) andnumber
(of the issue) columns in thewhere
orjoin
clause to query the table.
Examples
List all comments for a specific pull request
Determine the areas in which user comments on a particular pull request can provide valuable insights. This query is useful for understanding user engagement and feedback on specific code changes in a GitHub repository.
select id, author_login, author_association, body_text, created_at, updated_at, published_at, last_edited_at, editor_login, urlfrom github_pull_request_commentwhere repository_full_name = 'turbot/steampipe-plugin-github' and number = 207;
select id, author_login, author_association, body_text, created_at, updated_at, published_at, last_edited_at, editor_login, urlfrom github_pull_request_commentwhere repository_full_name = 'turbot/steampipe-plugin-github' and number = 207;
List comments for a specific pull request which match a certain body content
Determine the comments for a specific project update that contain a particular keyword. This is useful for filtering and understanding discussions related to specific topics or issues in your project.
select id, number as issue, author_login as comment_author, author_association, body_text as content, created_at, urlfrom github_pull_request_commentwhere repository_full_name = 'turbot/steampipe-plugin-github' and number = 207 and body_text ~~* '%DELAY%';
select id, number as issue, author_login as comment_author, author_association, body_text as content, created_at, urlfrom github_pull_request_commentwhere repository_full_name = 'turbot/steampipe-plugin-github' and number = 207 and body_text like '%DELAY%';
List comments for all open pull requests from a specific repository
Explore the discussion around ongoing modifications in a specific project by viewing the comments on all open pull requests. This can aid in understanding the current issues, proposed solutions, and overall progress of the project.
select c.*from github_pull_request r join github_pull_request_comment c on r.repository_full_name = c.repository_full_name and r.number = c.numberwhere r.repository_full_name = 'turbot/steampipe-plugin-github' and r.state = 'OPEN';
select c.*from github_pull_request r join github_pull_request_comment c on r.repository_full_name = c.repository_full_name and r.number = c.numberwhere r.repository_full_name = 'turbot/steampipe-plugin-github' and r.state = 'OPEN';
Schema for github_pull_request_comment
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
author | jsonb | The actor who authored the comment. | |
author_association | text | Author's association with the subject of the issue/pr the comment was raised on. | |
author_login | text | The login of the comment author. | |
body | text | The contents of the comment as markdown. | |
body_text | text | The contents of the comment as text. | |
can_delete | boolean | If true, user can delete the comment. | |
can_minimize | boolean | If true, user can minimize the comment. | |
can_react | boolean | If true, user can react to the comment. | |
can_update | boolean | If true, user can update the comment. | |
cannot_update_reasons | jsonb | A list of reasons why user cannot update the comment. | |
created_at | timestamp with time zone | Timestamp when comment was created. | |
created_via_email | boolean | If true, comment was created via email. | |
did_author | boolean | If true, user authored the comment. | |
editor | jsonb | The actor who edited the comment. | |
editor_login | text | The login of the comment editor. | |
id | bigint | The ID of the comment. | |
includes_created_edit | boolean | If true, comment was edited and includes an edit with the creation data. | |
is_minimized | boolean | If true, comment has been minimized. | |
last_edited_at | timestamp with time zone | Timestamp when comment was last edited. | |
login_id | text | =, !=, ~~, ~~*, !~~, !~~* | Unique identifier for the user login. |
minimized_reason | text | The reason for comment being minimized. | |
node_id | text | The node ID of the comment. | |
number | bigint | = | The issue/pr number. |
published_at | timestamp with time zone | Timestamp when comment was published. | |
repository_full_name | text | = | The full name of the repository (login/repo-name). |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
updated_at | timestamp with time zone | Timestamp when comment was last updated. | |
url | text | URL for the comment. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- github
You can pass the configuration to the command with the --config
argument:
steampipe_export_github --config '<your_config>' github_pull_request_comment