File Coverage

blib/lib/Net/GitHub/V3/Actions.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 24 24 100.0


line stmt bran cond sub pod time code
1             package Net::GitHub::V3::Actions;
2              
3 1     1   6 use Moo;
  1         2  
  1         5  
4              
5             our $VERSION = '1.05';
6             our $AUTHORITY = 'cpan:FAYLAND';
7              
8 1     1   335 use Carp;
  1         3  
  1         88  
9 1     1   7 use URI::Escape;
  1         2  
  1         90  
10 1     1   7 use URI;
  1         2  
  1         24  
11 1     1   5 use HTTP::Request::Common qw(POST);
  1         2  
  1         164  
12              
13             with 'Net::GitHub::V3::Query';
14              
15             ## build methods on fly
16             my %__methods = (
17              
18             ### -------------------------------------------------------------------------------
19             ### Artifacts
20             ### -------------------------------------------------------------------------------
21              
22             # List artifacts for a repository
23             artifacts => { v => 2, url => '/repos/:owner/:repo/actions/artifacts', method => 'GET', paginate => 1 },
24              
25             # List workflow run artifacts
26             # GET /repos/:owner/:repo/actions/runs/:run_id/artifacts
27             run_artifacts => { v => 2, url => '/repos/:owner/:repo/actions/runs/:run_id/artifacts', method => 'GET', paginate => 1 },
28              
29             # Get an artifact
30             # GET /repos/:owner/:repo/actions/artifacts/:artifact_id
31             artifact => { v => 2, url => '/repos/:owner/:repo/actions/artifacts/:artifact_id', method => 'GET' },
32              
33             ### -------------------------------------------------------------------------------
34             ### Workflows - https://developer.github.com/v3/actions/workflows/
35             ### -------------------------------------------------------------------------------
36              
37             # List repository workflows
38             # GET /repos/:owner/:repo/actions/workflows
39             workflows => { v => 2, url => '/repos/:owner/:repo/actions/workflows', method => 'GET', paginate => 1 },
40              
41             # Get a workflow
42             # GET /repos/:owner/:repo/actions/workflows/:workflow_id
43             workflow => { v => 2, url => '/repos/:owner/:repo/actions/workflows/:workflow_id', method => 'GET' },
44              
45             ### -------------------------------------------------------------------------------
46             ### Workflow Jobs - https://developer.github.com/v3/actions/workflow-jobs/
47             ### -------------------------------------------------------------------------------
48              
49             # List jobs for a workflow run
50             # GET /repos/:owner/:repo/actions/runs/:run_id/jobs pagination
51             jobs => { v => 2, url => '/repos/:owner/:repo/actions/runs/:run_id/jobs', method => 'GET', paginate => 1 },
52              
53             # Get a workflow job
54             # GET /repos/:owner/:repo/actions/jobs/:job_id
55             job => { v => 2, url => '/repos/:owner/:repo/actions/jobs/:job_id', method => 'GET' },
56              
57             ### -------------------------------------------------------------------------------
58             ### Workflow Runs - https://developer.github.com/v3/actions/workflow-runs/
59             ### -------------------------------------------------------------------------------
60              
61             runs => { v => 2, url => '/repos/:owner/:repo/actions/workflows/:workflow_id/runs', method => 'GET', paginate => 1 },
62              
63             # ...
64             );
65             __build_methods( __PACKAGE__, %__methods );
66              
67 1     1   14 no Moo;
  1         2  
  1         5  
68              
69             1;
70             __END__