github Provider¶
Auth provider: github — one token
(RUNTIME_GITHUB_TOKEN) serves every operation,
whatever transport it uses.
Operations¶
| Operation | Transport |
|---|---|
repo list [org] [key=value...] |
rest |
repo view <owner>/<repo> |
rest |
repo create <key=value...> |
rest |
repo summary <owner>/<repo> |
graphql |
issue list [key=value...] |
rest |
issue create |
cli (gh) |
org list |
rest |
team list |
rest |
user get |
rest |
notification list |
rest |
pr list / pr view / pr create |
cli (gh) |
workflow list / workflow run |
cli (gh) |
run list / run view |
cli (gh) |
api <METHOD> <path> [key=value...] |
rest |
graphql <query> [key=value...] |
graphql |
repo summary is GraphQL because it answers in one round trip what REST needs
four calls for. That is the provider's stated rule for choosing GraphQL — and
it is the provider's decision, not yours.
The table can't drift
A test asserts that every declared operation actually resolves, so the
published surface always matches the implementation. Still prefer
runtime github --help — it describes the binary you have installed.
Argument conventions¶
| Convention | Meaning |
|---|---|
key=value |
Query parameters on GET/DELETE; JSON body fields on POST/PUT/PATCH. true/false and integers are coerced to real types |
{org} |
Auto-substituted from the active Runtime Context |
{owner}, {repo}, {branch} |
Literal placeholders — substitute them yourself |
Operations that fall back to Runtime Context when no org is given:
repo list, issue list, team list.
runtime context use staging
runtime github repo list # defaults to staging's github.organization
runtime github repo list acme # explicit argument wins
CLI-backed operations forward flags verbatim¶
runtime github pr list --state open --limit 100
runtime github pr list --repo cli/cli --json number,title,author,reviewDecision
runtime github run view 1234567890 --log-failed
gh's own flags — including --json — reach it untouched, because provider
commands disable flag parsing. gh auth login is never needed: the runtime
forwards the validated token as GH_TOKEN.
Combine with the runtime's own output flag by putting it first:
The escape hatches¶
When no curated operation covers what you need:
# any REST endpoint
runtime github api GET /repos/cli/cli/community/profile
runtime github api PATCH /repos/{owner}/{repo} default_branch=main delete_branch_on_merge=true
runtime github api PUT /repos/{owner}/{repo}/topics names[]=service names[]=go
# any GraphQL query
runtime github graphql 'query($org:String!){ organization(login:$org){ repositories(first:100){ nodes{ nameWithOwner isPrivate } } } }' org=my-org
# anything gh does that the provider doesn't expose
runtime command run gh secret set DEPLOY_KEY --repo {owner}/{repo} --body "value"
runtime command run gh release create v1.2.0 --generate-notes
These are escape hatches, not a default style. Prefer a curated operation when one exists — it is the stable contract.
api DELETE is denied by the seeded policy
The api escape hatch can reach any REST endpoint, including destructive
ones the curated operations deliberately don't expose. There is no
repo delete operation — the escape hatch was the only way to reach it, so
denying the DELETE method closes that path.
Loosen it in policy-config.yaml if you
genuinely need it, and expect the denial in the audit log either way.
Common use cases¶
The Runtime Home ships a full use-case reference — organized by what engineers are trying to achieve rather than by API surface:
It covers golden-path service onboarding, repository inventory and standards audits, access review, branch protection compliance, review throughput, CI/CD health, releases, security posture, dependency hygiene, incident forensics, secrets configuration, onboarding/offboarding, DORA-shaped metrics, issue triage, and repository lifecycle.
A few representative starting points:
What doesn't work, and why¶
| Endpoint / pattern | Why |
|---|---|
/app, /app/installations, /marketplace_listing/*, /user/installations |
Need a GitHub App JWT, not a personal access token. Expect 401 |
api GET /search/issues with no q= |
Returns 422. Quote the whole pair: 'q=repo:cli/cli is:open' |
/user/packages with no package_type= |
Requires container, npm, maven, … |
| Org audit log | Enterprise Cloud only, absent from the public REST description. Use the Enterprise API or a UI export |
| Reading a secret's value | Never readable by design — only names and metadata |
| Setting a secret via raw REST | Needs libsodium encryption. Use command run gh secret set |
| 403 on org security endpoints | Usually means GitHub Advanced Security isn't enabled for that org |
The runtime percent-encodes query values, so spaces and colons in a search query are safe once the shell keeps the pair as one token.
In capabilities¶
workflow:
- provider: github
args: [repo, list, "${organization}", per_page=100]
- provider: github
args: [repo, summary, "${repository}"]
- provider: github
args: [api, GET, "/repos/${repository}/community/profile"]
Declare inputs; never hardcode an org, repo or environment. Never name a
transport. See the
Authoring Reference, and
~/.engineering-runtime/specs/github/capability-spec-github.md for the
GitHub-specific contract.