Use Octokit's previews API

Signed-off-by: Tejas Kumar <tejask@spotify.com>
This commit is contained in:
Tejas Kumar
2021-05-18 17:06:35 +02:00
parent 16cdf5cda2
commit c2cfac4cbe
@@ -89,16 +89,15 @@ export const enableBranchProtectionOnDefaultRepoBranch = async ({
try {
await client.repos.updateBranchProtection({
headers: {
Accept:
/**
* 👇 we need this header because allowing a custom
* reviewer count on branch protection is a preview
* feature.
*
* More here: https://docs.github.com/en/rest/overview/api-previews#require-multiple-approving-reviews
*/
'application/vnd.github.luke-cage-preview+json',
mediaType: {
/**
* 👇 we need this preview because allowing a custom
* reviewer count on branch protection is a preview
* feature.
*
* More here: https://docs.github.com/en/rest/overview/api-previews#require-multiple-approving-reviews
*/
previews: ['luke-cage-preview'],
},
owner,
repo: repoName,