-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 262: added support for branch protection API
- Loading branch information
Showing
5 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.kohsuke.github; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* @author Kohsuke Kawaguchi | ||
* @see GHBranch#disableProtection() | ||
*/ | ||
class BranchProtection { | ||
boolean enabled; | ||
RequiredStatusChecks requiredStatusChecks; | ||
|
||
static class RequiredStatusChecks { | ||
EnforcementLevel enforcement_level; | ||
List<String> contexts = new ArrayList<String>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.kohsuke.github; | ||
|
||
import java.util.Locale; | ||
|
||
/** | ||
* @author Kohsuke Kawaguchi | ||
*/ | ||
public enum EnforcementLevel { | ||
OFF, NON_ADMINS, EVERYONE; | ||
|
||
public String toString() { | ||
return name().toLowerCase(Locale.ENGLISH); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters