GitHub REST API docs works via curl or gh api
- Octokit core.js is the official JS client for the REST API
pnpm add @octokit/core
Only available via REST. See index.js for a detailed example.
const response = await octokit.request(
`GET /repos/${owner}/${repo}/branches/${branch}/protection`,
{
owner: owner,
repo: repo,
branch: branch,
headers: {
"X-GitHub-Api-Version": "2022-11-28",
},
},
);