type Github = {
token: string;
};
/**
* Rerequest a check suite
* Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.
To rerequest a check suite, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository.
*/
export async function main(
auth: Github,
owner: string,
repo: string,
check_suite_id: string
) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/check-suites/${check_suite_id}/rerequest`
);
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 367 days ago
type Github = {
token: string;
};
/**
* Rerequest a check suite
* Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.
To rerequest a check suite, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository.
*/
export async function main(
auth: Github,
owner: string,
repo: string,
check_suite_id: string
) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/check-suites/${check_suite_id}/rerequest`
);
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 927 days ago