From 38f1d53e5d29ad6014bc6e72b3989cfe35489f2e Mon Sep 17 00:00:00 2001 From: dzdidi Date: Mon, 29 Jan 2024 09:37:03 +0000 Subject: [PATCH] branch protection Signed-off-by: dzdidi --- src/acl.js | 1 + 1 file changed, 1 insertion(+) 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) }