API reference
Link a pull request
Link a pull request to a document, by repository and number or by its URL, as what implements it, a part of it or a related change. Linking one already linked changes its role. Its state is then kept current from GitHub.
Needs scope decisions:write.
bearerAuthorizationBearer <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.
space_id*stringThe space.
document_id*stringThe document's id, or what people call it (RFC 0080.1, prd-39).
iohr.decisions.v1.LinkPullRequestRequest; path variables override their fields
application/json- body
iohr.decisions.v1.LinkPullRequestRequest
document_id?stringnumber?integerint32repo?stringrole?stringsource?stringspace_id?stringurl?stringiohr.decisions.v1.LinkPullRequestResponse
application/json- response
iohr.decisions.v1.LinkPullRequestResponse
created*booleanpull_request?iohr.decisions.v1.PullRequest
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.decisions.linkPullRequest("<space_id>", "<document_id>", { repo: "<repo>", role: "<role>", source: "<source>", url: "<url>", }); 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.
{ "created": true, "pull_request": { "author": "string", "checks": "string", "checks_failed": 0, "checks_passed": 0, "checks_pending": 0, "closed_at": "string", "document_id": "string", "document_kind": "string", "document_number": "string", "forge": "string", "linked_at": "string", "linked_by": "string", "merge_commit": "string", "merged_at": "string", "number": 0, "pull_request_id": "string", "refresh": "string", "refreshed_at": "string", "repo": "string", "review_decision": "string", "role": "string", "source": "string", "state": "string", "title": "string", "updated_at": "string", "url": "string", "via": "string" }}List pull requests GET
The pull requests linked to a document, or to every document of a space, newest link first, with their state as last read from GitHub (title, author, draft, open, closed or merged, the review decision, the checks, when it merged and as which commit), the document each is on, and counts by state. Needs scope `decisions:read`.
Unlink a pull request POST
Unlink a pull request from a document, named by its id, by repository and number, or by its URL. The link's history is kept. Needs scope `decisions:write`.