-
Notifications
You must be signed in to change notification settings - Fork 1
/
github_repos_commits.body.sql
95 lines (68 loc) · 1.93 KB
/
github_repos_commits.body.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
create or replace package body github_repos_commits
as
function list_repos_commits (
git_account varchar2
, repos_name varchar2
, sha varchar2 default null
, path varchar2 default null
, author varchar2 default null
, since varchar2 default null
, until varchar2 default null
)
return github.call_result
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/commits', 'GET');
if sha is not null then
github.github_call_request.call_json.put('sha', sha);
end if;
if path is not null then
github.github_call_request.call_json.put('path', path);
end if;
if author is not null then
github.github_call_request.call_json.put('author', author);
end if;
if since is not null then
github.github_call_request.call_json.put('since', since);
end if;
if until is not null then
github.github_call_request.call_json.put('until', until);
end if;
github.talk(
github_account => git_account
);
return github.github_response_result;
end list_repos_commits;
function get_commit (
git_account varchar2
, repos_name varchar2
, sha varchar2
)
return github.call_result
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/commits/' || sha, 'GET');
github.talk(
github_account => git_account
);
return github.github_response_result;
end get_commit;
function compare_commits (
git_account varchar2
, repos_name varchar2
, base varchar2
, head varchar2
)
return github.call_result
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/compare/' || base || '...' || head, 'GET');
github.github_call_request.call_json.put('base', base);
github.github_call_request.call_json.put('head', head);
github.talk(
github_account => git_account
);
return github.github_response_result;
end compare_commits;
end github_repos_commits;
/