diff --git a/src/acl.js b/src/acl.js index 08b7b7e..b22344c 100644 --- a/src/acl.js +++ b/src/acl.js @@ -61,6 +61,7 @@ function revokeAccessFromUser (repoName, user) { function addProtectedBranch (repoName, branch) { const acl = getACL(repoName) + if (acl.protectedBranches.includes(branch)) throw new Error(`${branch} is already protected`) acl.protectedBranches.push(branch) setACL(repoName, acl) }