GitHub
GitHub's own REST API, keyless.
GitHub's own REST API, keyless. Built: a public repo's commit log (sha, author, date, message), paged and windowed; a public repo's release history (tag, name, dates, release notes text), paged. Declared, not yet built: repo metadata (getRepo).
Domain: github.com
Also known as: GitHub, Github, github.com
Prefer the capability
bowmark.git_commit_history covers this provider and routes around it when it is having a bad day. Reach for this page when you need github.com specifically.
Call it directly
bowmark.providers.github.listCommits(owner: string, repo: string, options?: GithubListCommitsOptions): Promise<GithubListCommitsResult>
bowmark.providers.github.listReleases(owner: string, repo: string, options?: GithubListReleasesOptions): Promise<GithubListReleasesResult>Functions
| Function | What it does |
|---|---|
listCommits | Returns a public repo's commit log off GitHub's own unauthenticated REST commits endpoint — each commit's sha, author name/email, author date, message and its own github.com URL. |
listReleases | Returns a public repo's release history off GitHub's own unauthenticated REST releases endpoint — each release's tag, name, draft/prerelease flags, created/published dates, its release… |
Types
interface GithubCommit {
sha: string;
authorName: string;
authorEmail: string;
date: string;
message: string;
url: string;
}
interface GithubListCommitsOptions {
sha?: string;
since?: string;
until?: string;
per_page?: number;
page?: number;
}
interface GithubListCommitsResult {
commits: GithubCommit[];
warnings: string[];
}
interface GithubRelease {
tag: string;
name: string;
draft: boolean;
prerelease: boolean;
createdAt: string;
publishedAt: string | null;
notes: string;
url: string;
}
interface GithubListReleasesOptions {
per_page?: number;
page?: number;
}
interface GithubListReleasesResult {
releases: GithubRelease[];
warnings: string[];
}Examples
const { commits } = await bowmark.providers.github.listCommits("octocat", "Hello-World", { per_page: 5 });
for (const c of commits) log(`${c.sha.slice(0, 7)} ${c.authorName}: ${c.message.split("\n")[0]}`);// Windowed by date, paging past the default branch's tip.
const page2 = await bowmark.providers.github.listCommits("octocat", "Hello-World", {
since: "2011-01-01T00:00:00Z",
per_page: 20,
page: 2,
});Related
git_commit_history | Git commit history — the capability this provider backs. |
git_release_notes | Git release notes — the capability this provider backs. |