turbot/github

steampipe plugin install githubsteampipe plugin install github
On This Page
Get Involved

Table: github_pull_request

GitHub pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

The github_pull_request table can be used to query issues belonging to a repository. You must specify which repository in a where or join clause (where repository_full_name=', join github_pull_request on repository_full_name=).

Examples

List open pull requests in a repository

select
repository_full_name,
issue_number,
title,
state,
mergeable
from
github_pull_request
where
repository_full_name = 'turbot/steampipe'
and state = 'open';

List the pull requests for a repository that have been closed in the last week

select
repository_full_name,
issue_number,
title,
state,
closed_at,
merged_at,
merged_by_login
from
github_pull_request
where
repository_full_name = 'turbot/steampipe'
and state = 'closed'
and closed_at >= (current_date - interval '7' day)
order by
closed_at desc;

List the open PRs in a repository with a given label

select
repository_full_name,
issue_number,
title,
state,
tags
from
github_pull_request
where
repository_full_name = 'turbot/steampipe'
and state = 'open'
and tags ? 'bug';

List the open PRs in a repository assigned to a specific user

select
repository_full_name,
issue_number,
title,
state,
assigned_to
from
github_pull_request,
jsonb_array_elements_text(assignee_logins) as assigned_to
where
repository_full_name = 'turbot/steampipe'
and assigned_to = 'binaek89'
and state = 'open';

Join with github_my_repository to find open PRs in multiple repos

select
i.repository_full_name,
i.issue_number,
i.title
from
github_my_repository as r,
github_pull_request as i
where
r.full_name like 'turbot/steampip%'
and i.state = 'open'
and i.repository_full_name = r.full_name;

.inspect github_pull_request

GitHub Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

NameTypeDescription
additionsbigintThe number of additions in this PR.
assignee_loginsjsonbAn array of user login names that are assigned to the issue.
author_associationtextThe association of the PR issue author to the repository (COLLABORATOR,CONTRIBUTOR, etc).
author_logintextThe login name of the user that submitted the PR.
bodytextThe body of the PR issue text.
changed_filesbigintThe number of changed files in this PR.
closed_attimestamp without time zoneThe timestamp when the PR was closed.
commentsbigintThe number of comments on the PR.
comments_urltextThe API Comments URL.
commitsbigintThe number of commits in this PR.
commits_urltextThe URL of the Commits page in GitHub.
created_attimestamp without time zoneThe timestamp when the PR was created.
deletionsbigintThe number of deletions in this PR.
diff_urltextThe URL of the Diff page in GitHub.
draftbooleanIf true, the PR is in draft.
html_urltextThe URL of the PR page in GitHub.
idbigintThe unique ID number of the PR issue.
issue_numberbigintThe PR issue number.
issue_urltextThe URL of the Issue page in GitHub.
labelsjsonbAn array of labels associated with this PR.
lockedbooleanIf true, the PR is locked.
maintainer_can_modifybooleanIf true, people with push access to the upstream repository of a fork owned by a user account can commit to the forked branches.
merge_commit_shatextThe commit sha of the merged PR.
mergeablebooleanIf true, the PR can be merged.
mergeable_statetextThe mergeability state of the PR.
mergedbooleanIf true, the PR has been merged.
merged_attimestamp without time zoneThe timestamp when the PR was merged.
merged_by_logintextThe login name of the user that submitted the PR.
milestone_idbigintThe milestone id this issue is associated with.
milestone_titletextThe title of the milestone this issue is associated with.
node_idtextThe node id of the PR.
patch_urltextThe URL of the Patch page in GitHub.
rebaseablebooleanIf true, the PR can be rebased.
repository_full_nametextThe full name of the repository (login/repo-name).
requested_reviewer_loginsjsonbAn array of user login names that are requested reviewers of the PR.
review_comment_urltextThe URL of the Review Comment page in GitHub.
review_commentsbigintThe number of review comments in this PR.
review_comments_urltextThe URL of the Review Comments page in GitHub.
statetextThe state or the PR (open, closed).
statuses_urltextThe URL of the Statuses page in GitHub.
tagsjsonbA map of label names associated with this PR, in Steampipe standard format.
titletextThe PR issue title.
updated_attimestamp without time zoneThe timestamp when the PR was last updated.
urltextThe API URL of the PR.