summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Net/GitHub.pm2
-rw-r--r--lib/Net/GitHub/V3.pm2
-rw-r--r--lib/Net/GitHub/V3/Actions.pm2
-rw-r--r--lib/Net/GitHub/V3/Events.pm2
-rw-r--r--lib/Net/GitHub/V3/Gists.pm2
-rw-r--r--lib/Net/GitHub/V3/GitData.pm2
-rw-r--r--lib/Net/GitHub/V3/Gitignore.pm2
-rw-r--r--lib/Net/GitHub/V3/Issues.pm2
-rw-r--r--lib/Net/GitHub/V3/OAuth.pm2
-rw-r--r--lib/Net/GitHub/V3/PullRequests.pm2
-rw-r--r--lib/Net/GitHub/V3/Query.pm2
-rw-r--r--lib/Net/GitHub/V3/Repos.pm43
-rw-r--r--lib/Net/GitHub/V3/ResultSet.pm2
-rw-r--r--lib/Net/GitHub/V3/Users.pm2
-rw-r--r--lib/Net/GitHub/V4.pm2
15 files changed, 56 insertions, 15 deletions
diff --git a/lib/Net/GitHub.pm b/lib/Net/GitHub.pm
index 04c874f..5dd9fd3 100644
--- a/lib/Net/GitHub.pm
+++ b/lib/Net/GitHub.pm
@@ -2,7 +2,7 @@ package Net::GitHub;
use Net::GitHub::V3;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
sub new {
diff --git a/lib/Net/GitHub/V3.pm b/lib/Net/GitHub/V3.pm
index ff0f703..9c9756a 100644
--- a/lib/Net/GitHub/V3.pm
+++ b/lib/Net/GitHub/V3.pm
@@ -3,7 +3,7 @@ package Net::GitHub::V3;
use Moo;
use Types::Standard qw(InstanceOf);
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
with 'Net::GitHub::V3::Query';
diff --git a/lib/Net/GitHub/V3/Actions.pm b/lib/Net/GitHub/V3/Actions.pm
index 4515677..a137bb5 100644
--- a/lib/Net/GitHub/V3/Actions.pm
+++ b/lib/Net/GitHub/V3/Actions.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::Actions;
use Moo;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use Carp;
diff --git a/lib/Net/GitHub/V3/Events.pm b/lib/Net/GitHub/V3/Events.pm
index 71558d0..867ad3f 100644
--- a/lib/Net/GitHub/V3/Events.pm
+++ b/lib/Net/GitHub/V3/Events.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::Events;
use Moo;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI::Escape;
diff --git a/lib/Net/GitHub/V3/Gists.pm b/lib/Net/GitHub/V3/Gists.pm
index 6b5c196..96e6634 100644
--- a/lib/Net/GitHub/V3/Gists.pm
+++ b/lib/Net/GitHub/V3/Gists.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::Gists;
use Moo;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI::Escape;
diff --git a/lib/Net/GitHub/V3/GitData.pm b/lib/Net/GitHub/V3/GitData.pm
index b742ae4..dd9254f 100644
--- a/lib/Net/GitHub/V3/GitData.pm
+++ b/lib/Net/GitHub/V3/GitData.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::GitData;
use Moo;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI::Escape;
diff --git a/lib/Net/GitHub/V3/Gitignore.pm b/lib/Net/GitHub/V3/Gitignore.pm
index b1c6e76..1a4784d 100644
--- a/lib/Net/GitHub/V3/Gitignore.pm
+++ b/lib/Net/GitHub/V3/Gitignore.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::Gitignore;
use Moo;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI::Escape;
diff --git a/lib/Net/GitHub/V3/Issues.pm b/lib/Net/GitHub/V3/Issues.pm
index 7da91c3..3e4267d 100644
--- a/lib/Net/GitHub/V3/Issues.pm
+++ b/lib/Net/GitHub/V3/Issues.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::Issues;
use Moo;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI::Escape;
diff --git a/lib/Net/GitHub/V3/OAuth.pm b/lib/Net/GitHub/V3/OAuth.pm
index c6c90b9..3916380 100644
--- a/lib/Net/GitHub/V3/OAuth.pm
+++ b/lib/Net/GitHub/V3/OAuth.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::OAuth;
use Moo;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI::Escape;
diff --git a/lib/Net/GitHub/V3/PullRequests.pm b/lib/Net/GitHub/V3/PullRequests.pm
index 2c78e63..92c0459 100644
--- a/lib/Net/GitHub/V3/PullRequests.pm
+++ b/lib/Net/GitHub/V3/PullRequests.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::PullRequests;
use Moo;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI;
diff --git a/lib/Net/GitHub/V3/Query.pm b/lib/Net/GitHub/V3/Query.pm
index f25041c..3326008 100644
--- a/lib/Net/GitHub/V3/Query.pm
+++ b/lib/Net/GitHub/V3/Query.pm
@@ -1,6 +1,6 @@
package Net::GitHub::V3::Query;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI;
diff --git a/lib/Net/GitHub/V3/Repos.pm b/lib/Net/GitHub/V3/Repos.pm
index fb39359..df4136c 100644
--- a/lib/Net/GitHub/V3/Repos.pm
+++ b/lib/Net/GitHub/V3/Repos.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::Repos;
use Moo;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use Carp;
@@ -336,6 +336,10 @@ my %__methods = (
participation => { url => "/repos/%s/%s/stats/participation", method => 'GET'},
punch_card => { url => "/repos/%s/%s/stats/punch_card", method => 'GET'},
+ # https://docs.github.com/en/rest/branches/branch-protection
+ branch_protection => { url => "/repos/%s/%s/branches/%s/protection", method => 'GET'},
+ delete_branch_protection => { url => "/repos/%s/%s/branches/%s/protection", method => 'DELETE', check_status => 204 },
+ update_branch_protection => { url => "/repos/%s/%s/branches/%s/protection", method => 'PUT', args => 1 },
);
__build_methods(__PACKAGE__, %__methods);
@@ -996,6 +1000,43 @@ L<http://developer.github.com/v3/repos/statistics/>
=back
+=head3 Branch Protection API
+
+L<https://docs.github.com/en/rest/branches/branch-protection>
+
+=over 4
+
+=item branch_protection
+
+ my $protection = $repos->branch_protection('fayland', 'perl-net-github', 'master');
+
+=item delete_branch_protection
+
+ $repos->delete_branch_protection('fayland', 'perl-net-github', 'master');
+
+=item update_branch_protection
+
+ $repos->update_branch_protection('fayland', 'perl-net-github', 'master', {
+ allow_deletions => \0,
+ allow_force_pushes => \0,
+ block_creations => \1,
+ enforce_admins => \1,
+ required_conversation_resolution => \1,
+ required_linear_history => \0,
+ required_pull_request_reviews => {
+ dismiss_stale_reviews => \1,
+ require_code_owner_reviews => \1,
+ required_approving_review_count => 2,
+ },
+ required_status_checks => {
+ strict => \1,
+ contexts => []
+ },
+ restrictions => undef,
+ });
+
+=back
+
=head1 AUTHOR & COPYRIGHT & LICENSE
Refer L<Net::GitHub>
diff --git a/lib/Net/GitHub/V3/ResultSet.pm b/lib/Net/GitHub/V3/ResultSet.pm
index 2aab104..617504c 100644
--- a/lib/Net/GitHub/V3/ResultSet.pm
+++ b/lib/Net/GitHub/V3/ResultSet.pm
@@ -1,6 +1,6 @@
package Net::GitHub::V3::ResultSet;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use Types::Standard qw(Int Str ArrayRef Bool);
diff --git a/lib/Net/GitHub/V3/Users.pm b/lib/Net/GitHub/V3/Users.pm
index 23b8817..5147287 100644
--- a/lib/Net/GitHub/V3/Users.pm
+++ b/lib/Net/GitHub/V3/Users.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::Users;
use Moo;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI::Escape;
diff --git a/lib/Net/GitHub/V4.pm b/lib/Net/GitHub/V4.pm
index 4cb93f7..7d8d025 100644
--- a/lib/Net/GitHub/V4.pm
+++ b/lib/Net/GitHub/V4.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V4;
use Moo;
-our $VERSION = '1.03';
+our $VERSION = '1.05';
our $AUTHORITY = 'cpan:FAYLAND';
use URI;