@rawdash/connector-github
v0.29.2
Published
Rawdash connector for GitHub
Readme
@rawdash/connector-github
Sync pull requests, issues, deployments, releases, CI runs, and contributor activity from a GitHub repository.
Install
npm install @rawdash/connector-githubAuthentication
A personal access token is optional for public repositories but required for private repos and to avoid the low unauthenticated rate limit.
- Open GitHub → Settings → Developer settings → Personal access tokens.
- Generate a token with the
reposcope (read access is sufficient). - Store it as a secret and reference it from the connector config as
token: secret("GITHUB_TOKEN").
Configuration
| Field | Type | Required | Description |
| ------- | ------ | -------- | ------------------------------------- |
| owner | string | Yes | GitHub username or organization name. |
| repo | string | Yes | Repository name. |
| token | secret | No | GitHub PAT with repo scope. |
Resources
repo(entity) - Top-level repository stats (stars, forks, and watchers) as a single entity.- Endpoint:
GET /repos/{owner}/{repo}
- Endpoint:
workflow_run(event) - GitHub Actions CI pipeline executions.- Endpoint:
GET /repos/{owner}/{repo}/actions/runs
- Endpoint:
pull_request(entity) - Open and closed pull requests, including draft state, author, and review state.- Endpoint:
GET /repos/{owner}/{repo}/pulls - Review state is folded in from GET /repos/{owner}/{repo}/pulls/{number}/reviews per PR.
- Endpoint:
issue(entity) - Open and closed issues with labels, assignees, and author (pull requests excluded).- Endpoint:
GET /repos/{owner}/{repo}/issues
- Endpoint:
deployment(entity) - Deployments with their latest status, keyed by environment and ref.- Endpoint:
GET /repos/{owner}/{repo}/deployments - The latest status is folded in from GET /repos/{owner}/{repo}/deployments/{id}/statuses.
- Endpoint:
release(entity) - Published, draft, and prerelease GitHub releases.- Endpoint:
GET /repos/{owner}/{repo}/releases
- Endpoint:
contributor(entity) - Per-author commit counts for the repository.- Endpoint:
GET /repos/{owner}/{repo}/contributors
- Endpoint:
Example
import {
defineConfig,
defineDashboard,
defineMetric,
secret,
} from '@rawdash/core';
const github = {
name: 'github',
connectorId: 'github-actions',
config: {
owner: 'my-org',
repo: 'my-repo',
token: secret('GITHUB_TOKEN'),
},
};
export default defineConfig({
connectors: [github],
dashboards: {
engineering: defineDashboard({
widgets: {
open_prs: {
kind: 'stat',
title: 'Open PRs',
metric: defineMetric({
connector: github,
shape: 'entity',
entityType: 'pull_request',
fn: 'count',
filter: [{ field: 'state', op: 'eq', value: 'open' }],
}),
},
},
}),
},
});Rate limits
Unauthenticated requests share GitHub’s low 60 requests/hour limit; an authenticated token raises it to 5,000 requests/hour.
Limitations
- The GitHub REST API can return the same item more than once within a sync (cursor pagination overlapping a mutating collection, retried requests, or an item surfaced via multiple endpoints). Each resource dedupes by stable id before writing, keeping the last copy seen.
- Public repositories without a token are subject to GitHub’s low unauthenticated rate limit.
Links
License
Apache-2.0
