Skip to content

Commit 02ca438

Browse files
author
Thomas Maurel
committed
restrictions parameter is not required as by default team member of a repo will be able to merge pull requests
1 parent 4d47877 commit 02ca438

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

advanced_bin/github-createbranch

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,10 @@ sub protect_branch {
106106
return;
107107
}
108108
my $organisation = $opts->{organisation};
109-
my $json = get_json($opts, 'GET', "/repos/${organisation}/${repo}/teams");
110-
my $teams;
111-
foreach my $team (@{$json}){
112-
push @{$teams}, $team->{name};
113-
}
114109
my $required_pull_request_reviews = {"dismiss_stale_reviews" => \0,"require_code_owner_reviews" => \0,"required_approving_review_count" => 1};
115110
my $branch = $opts->{branch};
116111
print "* Protecting $branch in $repo\n";
117-
get_json($opts, 'PUT', "/repos/${organisation}/${repo}/branches/${branch}/protection", {required_status_checks => undef, enforce_admins => \1, required_pull_request_reviews => ${required_pull_request_reviews} ,restrictions => {"users" => [],"teams" => ${teams}}});
112+
get_json($opts, 'PUT', "/repos/${organisation}/${repo}/branches/${branch}/protection", {required_status_checks => undef, enforce_admins => \1, required_pull_request_reviews => ${required_pull_request_reviews}, restrictions => undef});
118113
print "* Done\n";
119114
return;
120115
}

0 commit comments

Comments
 (0)