Sign in
Docs

API reference

Get GitHub facts

Have a token? Manage tokens in the console
GET
/v1/accounts/orgs/{org_id}/connections/github/facts

What GitHub says about one of the account's repositories, through the account's installation of InOrbit's GitHub App: the default branch's sha, a pull request's head, state, mergeable and whether it merged, and the checks and statuses on its head with their conclusion and ci_ok. Each part says observed or why not (needs_permission names the GitHub permission to add) and carries an evidence id. Only the repositories listed for the account.

Needs scope connections:read.

Authorization

bearer
headerAuthorizationBearer <token>

An access token from the identity provider: a person's, or a customer's from the client credentials grant with an API key (developers.inorbit.hr). The gateway verifies it; the audience is iohr-api.

Path Parameters

org_id*string

The account's id: org in GET /v1/me.

Query Parameters

repository?string

The repository, owner/name.

pull_number?string

A pull request's number; 0 reads the branch only.

Formatint64
branch?string

A branch; empty is the pull request's base, else the default branch.

Response Body

iohr.connections.v1.GetGithubFactsResponse

application/json
  1. response

iohr.connections.v1.GetGithubFactsResponse

branch?

iohr.connections.v1.GithubBranch

checks?

iohr.connections.v1.GithubChecks

default_branch*string
installation_id*string
Formatint64
observed_at*string
pull_request?

iohr.connections.v1.GithubPullRequest

repository*string
repository_observation?

iohr.connections.v1.GithubObservation

import { ApiError, Public } from "@inorbithr/sdk";// Reads INORBIT_TOKEN, or INORBIT_KEY_ID and INORBIT_KEY_SECRET.const api = Public.fromEnv();try {  const { value } = await api.connections.getGithubFacts("<org_id>");  console.log(value);} catch (e) {  if (!(e instanceof ApiError)) throw e;  console.error(`${e.code}: ${e.problem} (request id ${e.raw.requestId})`);}

npm install @inorbithr/sdk. Calls the package's public surface; an operation newer than your package needs the next release or a client generated for your account. The SDKs.

{  "branch": {    "name": "string",    "observation": {      "detail": "string",      "evidence_id": "string",      "observed": true,      "reason": "string"    },    "sha": "string"  },  "checks": {    "ci_ok": true,    "conclusion": "string",    "runs": [      {        "conclusion": "string",        "name": "string",        "status": "string",        "url": "string"      }    ],    "runs_observation": {      "detail": "string",      "evidence_id": "string",      "observed": true,      "reason": "string"    },    "sha": "string",    "statuses": [      {        "conclusion": "string",        "name": "string",        "status": "string",        "url": "string"      }    ],    "statuses_observation": {      "detail": "string",      "evidence_id": "string",      "observed": true,      "reason": "string"    }  },  "default_branch": "string",  "installation_id": "string",  "observed_at": "string",  "pull_request": {    "base_ref": "string",    "draft": true,    "head_ref": "string",    "head_sha": "string",    "merge_commit_sha": "string",    "mergeable": true,    "mergeable_state": "string",    "merged": true,    "merged_into_default": true,    "number": "string",    "observation": {      "detail": "string",      "evidence_id": "string",      "observed": true,      "reason": "string"    },    "state": "string",    "title": "string",    "url": "string"  },  "repository": "string",  "repository_observation": {    "detail": "string",    "evidence_id": "string",    "observed": true,    "reason": "string"  }}