create-octokit-project
Version:
`npm init` script to create a new Octokit JS module (plugin, authentication strategy, or otherwise)
23 lines (22 loc) • 526 B
JavaScript
export async function createBranchProtection(octokit, { owner, repo }) {
await octokit.request(
"PUT /repos/{owner}/{repo}/branches/{branch}/protection",
{
mediaType: {
previews: ["luke-cage"],
},
owner,
repo,
branch: "main",
enforce_admins: null,
required_pull_request_reviews: {
dismiss_stale_reviews: true,
},
required_status_checks: {
strict: false,
contexts: ["WIP", "test"],
},
restrictions: null,
},
);
}