Skip to main content
Skip table of contents

[REST Basic Auth] GitHub API

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

Confluence page with live GitHub pull requests and issues displayed via PocketQuery, showing real-time author, status, and label data

Live GitHub data embedded in a Confluence page using PocketQuery

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

GitHub API [REST Basic]

Type

REST Basic Auth

Base URL

https://api.github.com

User

(leave empty)

Password

(paste your GitHub Personal Access Token)

Test path

/user/repos

Test the connection and save the datasource.

PocketQuery datasource configuration screen for GitHub REST API connection showing fields for base URL and test path.

Step 3: Create a Query in PocketQuery

Let’s start by fetching open pull requests for a specific repository.

Field

Value

Name

Open Pull Requests

Datasource

GitHub API [REST Basic]

Method

GET

REST URL

/repos/{owner}/{repo}/pulls?state=open

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:

CODE
#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

/repos/{owner}/{repo}/pulls?state=open

Open Issues

/repos/{owner}/{repo}/issues?state=open

Filtered Issues (e.g. bugs)

/repos/{owner}/{repo}/issues?state=open&labels=bug

Commits

/repos/{owner}/{repo}/commits

Contributors

/repos/{owner}/{repo}/contributors

GitHub Actions Runs

/repos/{owner}/{repo}/actions/runs

Deployments

/repos/{owner}/{repo}/deployments

Dependabot Alerts (Repo)

/repos/{owner}/{repo}/dependabot/alerts

Dependabot Alerts (Org)

/orgs/{org}/dependabot/alerts

Org Repositories

/orgs/{org}/repos

Rate Limit (for debugging)

/rate_limit

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

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.