Skip to main content

Module builtins_github

Module builtins_github 

Source
Expand description

GitHub REST API primitives — pragmatic wrappers around api.github.com.

Designed for parallel-map workflows:

my @repos = gh_repos("MenkeTechnologies")
my @stars = pmap { gh_repo($_->{full_name})->{stargazers_count} } @repos

All builtins authenticate via the GITHUB_TOKEN environment variable when present (5000 req/hour); otherwise fall back to unauthenticated access (60 req/hour). List endpoints auto-paginate up to a safety cap (GH_MAX_PAGES, default 10 = up to 1000 items at per_page=100).

Builtins: gh_get(PATH, [opts]) — generic GET, parsed JSON gh_user(USER) — /users/USER gh_org(ORG) — /orgs/ORG gh_repo(OWNER, REPO) — /repos/OWNER/REPO gh_repos(USER) — /users/USER/repos (paginated) gh_org_repos(ORG) — /orgs/ORG/repos (paginated) gh_starred(USER) — /users/USER/starred (paginated) gh_followers(USER) — /users/USER/followers (paginated) gh_following(USER) — /users/USER/following (paginated) gh_gists(USER) — /users/USER/gists (paginated) gh_gist(ID) — /gists/ID gh_issues(OWNER, REPO) — /repos/OWNER/REPO/issues (paginated) gh_prs(OWNER, REPO) — /repos/OWNER/REPO/pulls (paginated) gh_commits(OWNER, REPO) — /repos/OWNER/REPO/commits (paginated) gh_branches(OWNER, REPO) — /repos/OWNER/REPO/branches (paginated) gh_tags(OWNER, REPO) — /repos/OWNER/REPO/tags (paginated) gh_releases(OWNER, REPO) — /repos/OWNER/REPO/releases (paginated) gh_contributors(OWNER, REPO) — /repos/OWNER/REPO/contributors (paginated) gh_forks(OWNER, REPO) — /repos/OWNER/REPO/forks (paginated) gh_stargazers(OWNER, REPO) — /repos/OWNER/REPO/stargazers (paginated) gh_topics(OWNER, REPO) — array of topic names gh_languages(OWNER, REPO) — { language => bytes } hashref gh_readme(OWNER, REPO) — decoded README content (string) gh_workflows(OWNER, REPO) — workflows array gh_runs(OWNER, REPO) — workflow runs array gh_search_repos(QUERY) — /search/repositories (paginated) gh_search_users(QUERY) — /search/users (paginated) gh_search_code(QUERY) — /search/code (paginated) gh_search_issues(QUERY) — /search/issues (paginated) gh_rate_limit() — /rate_limit gh_meta() — /meta gh_zen() — /zen (plain-text string) gh_emojis() — /emojis (hashref)

Errors: network / 4xx / 5xx → runtime error. 404 returns undef so callers can pmap { gh_repo(...) } over a list including dead names without aborting the whole pipeline.

Functions§

gh_branches
gh_commits
gh_contributors
gh_emojis
gh_followers
gh_following
gh_forks
gh_get
gh_get(PATH) — GET an arbitrary GitHub REST endpoint. PATH can be a relative path (/users/MenkeTechnologies) or a full URL. Returns parsed JSON as a stryke value; 404 → undef.
gh_gist
gh_gists
gh_issues
gh_languages
gh_languages(OWNER, REPO){ language => bytes } hashref.
gh_meta
gh_org
gh_org_repos
gh_prs
gh_rate_limit
gh_readme
gh_readme(OWNER, REPO) — base64-decoded README content as a UTF-8 string.
gh_releases
gh_repo
gh_repos
gh_runs
gh_search_code
gh_search_issues
gh_search_repos
gh_search_users
gh_stargazers
gh_starred
gh_tags
gh_topics
gh_topics(OWNER, REPO) — returns an arrayref of topic name strings.
gh_user
gh_workflows
gh_zen
gh_zen() — GitHub’s “zen” endpoint. Returns a plain-text string, not JSON.