Which repository to default to
const url = 'https://api.pealboard.com/v1/github/default-repository/suggestion';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.pealboard.com/v1/github/default-repository/suggestion \ --header 'Authorization: Bearer <token>'Proposes the repository a workspace should send an issue to when nobody chose one, and where to create it if there is nothing to propose. Set the choice with PATCH /v1/workspace.
The suggestion is, in order: a synced repository named issues, roadmap, product, planning, tracker, support (case-insensitive), which is what a team that keeps one tracking repository calls it; failing that, the synced repository with the most open issues in the cache; failing both, null. A tie on the count is broken by full name, so two reads of the same screen agree.
Pealboard does not create the repository, and cannot. The App does not ask GitHub for the Administration permission — a product that can create repositories in a customer’s organization is asking for a permission every reviewer has to justify, for one screen. createUrl opens GitHub’s own new-repository form with the name filled in, on the organization when the installation is on one and on github.com/new when it is on a personal account. A repository created there appears here after it is added to the installation’s repository access and the next sync has run; it is not immediate, and nothing is wrong while it is not there yet.
Access. Requires the member role or above (member, admin, owner). Which repository a workspace should send issues to is a reading of repositories every member can already list. API-key scope: github:read.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The suggestion, and where to create one.
object
Null when no synced repository is named like a tracking repository and the cache holds no open issues yet.
object
A UUID this API issued.
Why this one, in a sentence a screen can show unchanged.
GitHub’s new-repository form, with the name filled in.
The name Pealboard proposes for it.
Example
{ "suggested": { "fullName": "mersoft-corp/issues", "reason": "Named issues, which is the usual name for a repository a team tracks work in." }, "createName": "issues"}No valid credentials.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}Authenticated, but not permitted.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}No such resource, or it is not visible to you.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}The request conflicts with the current state.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}The request did not match the expected shape.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}Rate limited. Retry after the interval in the header.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}GitHub or another dependency refused or did not answer. Nothing in the workspace changed.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}