This guide shows you how to connect GitHub to PocketQuery using the GitHub REST API and display live GitHub data inside your Confluence pages.
At the end, you'll be able to visualize GitHub data like open pull requests, issues, or commits in a dynamic table.
Preview
Step 1: Create a GitHub Personal Access Token
-
Go to https://github.com/settings/tokens and create a new Personal Access Token.
-
Make sure the token has read-only permissions for the repositories or orgs you want to access.
-
Save the token securely.
Step 2: Create a Datasource in PocketQuery
Open PocketQuery Administration → Datasources, and create a new REST datasource:
|
Field |
Value |
|---|---|
|
Name |
|
|
Type |
|
|
Base URL |
|
|
User |
(leave empty) |
|
Password |
(paste your GitHub Personal Access Token) |
|
Test path |
|
Test the connection and save the datasource.
Step 3: Create a Query in PocketQuery
Let’s start by fetching open pull requests for a specific repository.
|
Field |
Value |
|---|---|
|
Name |
|
|
Datasource |
|
|
Method |
|
|
REST URL |
|
Replace {owner} and {repo} with your actual GitHub owner and repository name.
Step 4: Create a Template (Velocity)
Use the following Velocity template to render the API result as an interactive table:
#set($tableRows = $PQ.toList($result))
<table class="aui">
<thead>
<tr>
<th>Title</th>
<th>Author</th>
<th>Status</th>
<th>Updated at</th>
<th>Created at</th>
</tr>
</thead>
<tbody>
#foreach ($row in $tableRows)
<tr>
<td><a href="$row.html_url">$row.title</a></td>
<td>$row.get('user.login')</td>
<td>$row.state</td>
<td>$row.updated_at</td>
<td>$row.created_at</td>
</tr>
#end
</tbody>
</table>
This will display all open pull requests as a live table on your Confluence page.
Sample Use Cases
You can use the GitHub API with PocketQuery to build:
-
Sprint dashboards: Show PRs, issues, and commits by repo or label
-
Contributor boards: List top contributors per repo or org
-
Release monitors: Show GitHub Actions or workflow status
-
Security watchlists: Display Dependabot alerts across repos
🔗 Useful GitHub API Endpoints
|
Purpose |
Endpoint |
|---|---|
|
Open Pull Requests |
|
|
Open Issues |
|
|
Filtered Issues (e.g. bugs) |
|
|
Commits |
|
|
Contributors |
|
|
GitHub Actions Runs |
|
|
Deployments |
|
|
Dependabot Alerts (Repo) |
|
|
Dependabot Alerts (Org) |
|
|
Org Repositories |
|
|
Rate Limit (for debugging) |
|
Full documentation: GitHub REST API v3
Why Use PocketQuery for GitHub Integration?
-
No plugin development or external server needed
-
Secure: uses personal access tokens
-
Works in Confluence Cloud and Data Center
-
Supports custom tables, filters, dashboards
-
Combine GitHub with Jira, SQL, Sentry, and more