branch protection

Signed-off-by: dzdidi <deniszalessky@gmail.com>
This commit is contained in:
dzdidi
2024-01-29 09:37:03 +00:00
parent 58cbbdb6e2
commit 38f1d53e5d

View File

@@ -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)
}