Public
Edited
Feb 6, 2023
Insert cell
Insert cell
username = "microsoft"
Insert cell
repo = "typescript"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
artifacts = fetchGithub(`/repos/${username}/${repo}/actions/artifacts`)
Insert cell
artifact = artifacts?.artifacts?.length &&
fetchGithub(
`/repos/${username}/${repo}/actions/artifacts/${artifacts.artifacts[0].id}`
)
Insert cell
Insert cell
userEvents = fetchGithub(`/users/${username}/events/public`)
Insert cell
Insert cell
repoEvents = fetchGithub(`/repos/${username}/${repo}/events`)
Insert cell
Insert cell
stargazers = fetchGithub(`/repos/${username}/${repo}/stargazers`)
Insert cell
Insert cell
gists = fetchGithub(`/users/${username}/gists`)
Insert cell
Insert cell
gist = gistPick && fetchGithub(`/gists/${gistPick?.id}`)
Insert cell
gistCommits = gistPick && fetchGithub(`/gists/${gistPick?.id}/commits`)
Insert cell
Insert cell
gitignores = fetchGithub(`/gitignore/templates`)
Insert cell
Insert cell
gitignore = fetchGithub(`/gitignore/templates/${gitignoresPick}`)
Insert cell
Insert cell
Insert cell
issues = fetchGithub(
`/repos/${username}/${repo}/issues`,
{ state: "all" }, // default: "open"
{ headers: { accept: "application/vnd.github.squirrel-girl-preview" } } // to get reactions
)
Insert cell
Insert cell
issueComments = issues && fetchGithub(`/repos/${username}/${repo}/issues/${issuesPick?.number}/comments`)
Insert cell
Insert cell
Insert cell
issues && issues.filter(d => d.pull_request)
Insert cell
Insert cell
licenses = fetchGithub(`/licenses`)
Insert cell
repoLicense = fetchGithub(`/repos/${username}/${repo}/license`)
Insert cell
repoLicenseSource = repoLicense && fetchGithub(`/licenses/${repoLicense.license.key}`)
Insert cell
Insert cell
Insert cell
(await fetchGithubResponse(`/octocat`)).text()
Insert cell
(await fetchGithubResponse(`/zen`)).text()
Insert cell
Insert cell
organization = fetchGithub(`/orgs/${username}`)
Insert cell
organizations = fetchGithub(`/users/${username}/orgs`)
Insert cell
Insert cell
projectsMediaType = ({ headers: { accept: "application/vnd.github.inertia-preview+json" } })
Insert cell
projects = fetchGithub(`/repos/${username}/${repo}/projects`, {}, projectsMediaType)
// projects = fetchGithub(`/orgs/${username}/projects`, {}, projectsMediaType)
// projects = fetchGithub(`/users/${username}/projects`, {}, projectsMediaType)
Insert cell
Insert cell
columns = fetchGithub(`/projects/${projectsPick.id}/columns`, {}, projectsMediaType)
Insert cell
Insert cell
cards = fetchGithub(`/projects/columns/${columnsPick.id}/cards`, {}, projectsMediaType)
Insert cell
Insert cell
pullRequests = fetchGithub(`/repos/${username}/${repo}/pulls`)
Insert cell
Insert cell
pullRequestCommits = pullRequests && fetchGithub(`/repos/${username}/${repo}/pulls/${pullRequestsPick?.number}/commits`)
Insert cell
pullRequestComments = pullRequests && fetchGithub(`/repos/${username}/${repo}/pulls/${pullRequestsPick?.number}/comments`)
Insert cell
Insert cell
fetchGithub(`/rate_limit`)
Insert cell
Insert cell
repos = fetchGithub(`/users/${username}/repos`)
Insert cell
branches = fetchGithub(`/repos/${username}/${repo}/branches`)
Insert cell
collaborators = fetchGithub(`/repos/${username}/${repo}/collaborators`)
Insert cell
commits = fetchGithub(`/repos/${username}/${repo}/commits`)
Insert cell
forks = fetchGithub(`/repos/${username}/${repo}/forks`)
Insert cell
pages = fetchGithub(`/repos/${username}/${repo}/pages`)
Insert cell
releases = fetchGithub(`/repos/${username}/${repo}/releases`)
Insert cell
referrers = fetchGithub(`/repos/${username}/${repo}/traffic/popular/referrers`)
Insert cell
Insert cell
Insert cell
searchResults = fetchGithub(`/search/repositories`, {q: searchQuery})
Insert cell
Insert cell
Insert cell
you = fetchGithub(`/user`)
Insert cell
yourFollowers = fetchGithub(`/user/followers`)
Insert cell
yourFollowing = fetchGithub(`/user/following`)
Insert cell
user = fetchGithub(`/user/${username}`)
Insert cell
userFollowers = fetchGithub(`/user/${username}/followers`)
Insert cell
userFollowing = fetchGithub(`/user/${username}/following`)
Insert cell
Insert cell
Insert cell
import {toc} from "@mbostock/toc"
Insert cell
import {fetchGithub, fetchGithubResponse, hasApiKey, rateLimitSummary} from "@observablehq/github-actions-workflows-api"
Insert cell
// For a notebook to access Secrets, it must statically reference one; this cell grants Secret access to the notebook from which we import the GitHub API helpers. `undefined &&` prevents the Secret from appearing in plaintext in the Inspector.
undefined && Secret("GITHUB_ACCESS_TOKEN")
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more