Net::GitHub::V3::PullRequests - GitHub Pull Requests API
use Net::GitHub::V3; my $gh = Net::GitHub::V3->new; # read L<Net::GitHub::V3> to set right authentication info my $pull_request = $gh->pull_request;
To ease the keyboard, we provied two ways to call any method which starts with :user/:repo
1. SET user/repos before call methods below
$gh->set_default_user_repo('fayland', 'perl-net-github'); # take effects for all $gh-> $pull_request->set_default_user_repo('fayland', 'perl-net-github'); # only take effect to $gh->pull_request my @pulls = $pull_request->pulls();
2. If it is just for once, we can pass :user, :repo before any arguments
my @pulls = $pull_request->pulls($user, $repo);
http://developer.github.com/v3/pulls/
my @pulls = $pull_request->pulls(); my @pulls = $pull_request->pulls( { state => 'open' } );
my $pull = $pull_request->pull($pull_id);
my $pull = $pull_request->create_pull( { "title" => "Amazing new feature", "body" => "Please pull this in!", "head" => "octocat:new-feature", "base" => "master" } ); my $pull = $pull_request->update_pull( $pull_id, $new_pull_data );
my @commits = $pull_request->commits($pull_id); my @files = $pull_request->files($pull_id);
my $is_merged = $pull_request->is_merged($pull_id); my $result = $pull_request->merge($pull_id);
http://developer.github.com/v3/pulls/comments/
my @comments = $pull_request->comments($pull_id); my $comment = $pull_request->comment($comment_id); my $comment = $pull_request->create_comment($pull_id, { "body" => "a new comment", commit_id => '586fe4be94c32248043b344e99fa15c72b40d1c2', path => 'test', position => 1, }); my $comment = $pull_request->update_comment($comment_id, { "body" => "Nice change" }); my $st = $pull_request->delete_comment($comment_id);
Refer Net::GitHub
To install Net::GitHub, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::GitHub
CPAN shell
perl -MCPAN -e shell install Net::GitHub
For more information on module installation, please visit the detailed CPAN module installation guide.