1Net::GitHub::V3::PullReUqsueerstCso(n3t)ributed Perl DocNuemte:n:tGaittiHounb::V3::PullRequests(3)
2
3
4
6 Net::GitHub::V3::PullRequests - GitHub Pull Requests API
7
9 use Net::GitHub::V3;
10
11 my $gh = Net::GitHub::V3->new; # read L<Net::GitHub::V3> to set right authentication info
12 my $pull_request = $gh->pull_request;
13
15 To ease the keyboard, we provied two ways to call any method which
16 starts with :user/:repo
17
18 1. SET user/repos before call methods below
19
20 $gh->set_default_user_repo('fayland', 'perl-net-github'); # take effects for all $gh->
21 $pull_request->set_default_user_repo('fayland', 'perl-net-github'); # only take effect to $gh->pull_request
22 my @pulls = $pull_request->pulls();
23
24 2. If it is just for once, we can pass :user, :repo before any
25 arguments
26
27 my @pulls = $pull_request->pulls($user, $repo);
28
29 METHODS
30 Pull Requets
31
32 <http://developer.github.com/v3/pulls/>
33
34 pulls
35 my @pulls = $pull_request->pulls();
36 my @pulls = $pull_request->pulls( { state => 'open' } );
37 while (my $pr = $pull_request->next_pull( { state => 'open' } )) { ...; }
38
39 pull
40 my $pull = $pull_request->pull($pull_number);
41
42 create_pull
43 update_pull
44 my $pull = $pull_request->create_pull( {
45 "title" => "Amazing new feature",
46 "body" => "Please pull this in!",
47 "head" => "octocat:new-feature",
48 "base" => "master"
49 } );
50 my $pull = $pull_request->update_pull( $pull_number, $new_pull_data );
51
52 commits
53 files
54 my @commits = $pull_request->commits($pull_number);
55 my @files = $pull_request->files($pull_number);
56 while (my $commit = $pull_request->next_commit($pull_number)) { ...; }
57 while (my $file = $pull_request->next_file($pull_number)) { ...; }
58
59 is_merged
60 merge
61 my $is_merged = $pull_request->is_merged($pull_number);
62 my $result = $pull_request->merge($pull_number);
63
64 Pull Request Comments API
65
66 <http://developer.github.com/v3/pulls/comments/>
67
68 comments
69 comment
70 create_comment
71 update_comment
72 delete_comment
73 my @comments = $pull_request->comments($pull_number);
74 while (my $comment = $pull_request->next_comment($pull_number)) { ...; }
75 my $comment = $pull_request->comment($comment_id);
76 my $comment = $pull_request->create_comment($pull_number, {
77 "body" => "a new comment",
78 commit_id => '586fe4be94c32248043b344e99fa15c72b40d1c2',
79 path => 'test',
80 position => 1,
81 });
82 my $comment = $pull_request->update_comment($comment_id, {
83 "body" => "Nice change"
84 });
85 my $st = $pull_request->delete_comment($comment_id);
86
87 Pull Request Reviews API
88
89 <http://developer.github.com/v3/pulls/reviews/>
90
91 reviews
92 review
93 create_review
94 update_review
95 delete_review
96 my @reviews = $pull_request->reviews($pull_number);
97 while (my $review = $pull_request->next_review($pull_number)) { ...; }
98 my $review = $pull_request->review($review_id);
99 my $review = $pull_request->create_review($pull_number, {
100 "body" => "a new review",
101 commit_id => '586fe4be94c32248043b344e99fa15c72b40d1c2',
102 event => 'APPROVE',
103 });
104 my $review = $pull_request->update_review($review_id, {
105 "body" => "Nice change"
106 });
107 my $st = $pull_request->delete_review($review_id);
108
109 Pull Request Review API
110
111 <https://developer.github.com/v3/pulls/review_requests/>
112
113 reviewers
114 add_reviewers
115 delete_reviewers
116 my @reviewers = $pull_request->reviewers($pull_number);
117 my $result = $pull_request->add_reviewers($pull_number, {
118 reviewers => [$user1, $user2],
119 team_reviewers => [$team1],
120 );
121 my $result = $pull_request->delete_reviewers($pull_number, {
122 reviewers => [$user1, $user2],
123 team_reviewers => [$team1],
124 );
125
127 Refer Net::GitHub
128
129
130
131perl v5.34.1 2022-04-22 Net::GitHub::V3::PullRequests(3)