-
Notifications
You must be signed in to change notification settings - Fork 1
/
github_repos_releases.body.sql
138 lines (102 loc) · 3.08 KB
/
github_repos_releases.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
create or replace package body github_repos_releases
as
function list_releases (
git_account varchar2
, repos_name varchar2
)
return github.call_result
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/releases', 'GET');
github.talk(
github_account => git_account
);
return github.github_response_result;
end list_releases;
function get_release (
git_account varchar2
, repos_name varchar2
, release_id number
)
return github.call_result
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/releases/' || release_id, 'GET');
github.talk(
github_account => git_account
);
return github.github_response_result;
end get_release;
procedure create_release (
git_account varchar2
, repos_name varchar2
, tag_name varchar2
, target_commitish varchar2 default 'master'
, name varchar2 default null
, body varchar2 default null
, draft boolean default false
, prerelease boolean default false
)
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/releases', 'POST');
github.github_call_request.call_json.put('tag_name', tag_name);
github.github_call_request.call_json.put('target_commitish', target_commitish);
if name is not null then
github.github_call_request.call_json.put('name', name);
end if;
if body is not null then
github.github_call_request.call_json.put('body', body);
end if;
github.github_call_request.call_json.put('draft', draft);
github.github_call_request.call_json.put('prerelease', prerelease);
github.talk(
github_account => git_account
);
end create_release;
procedure edit_release (
git_account varchar2
, repos_name varchar2
, release_id number
, tag_name varchar2 default null
, target_commitish varchar2 default null
, name varchar2 default null
, body varchar2 default null
, draft boolean default false
, prerelease boolean default false
)
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/releases/' || release_id, 'PATCH');
if tag_name is not null then
github.github_call_request.call_json.put('tag_name', tag_name);
end if;
if target_commitish is not null then
github.github_call_request.call_json.put('target_commitish', target_commitish);
end if;
if name is not null then
github.github_call_request.call_json.put('name', name);
end if;
if body is not null then
github.github_call_request.call_json.put('body', body);
end if;
github.github_call_request.call_json.put('draft', draft);
github.github_call_request.call_json.put('prerelease', prerelease);
github.talk(
github_account => git_account
);
end edit_release;
procedure delete_release (
git_account varchar2
, repos_name varchar2
, release_id number
)
as
begin
github.init_talk('/repos/' || git_account || '/' || repos_name || '/releases/' || release_id, 'DELETE');
github.talk(
github_account => git_account
);
end delete_release;
end github_repos_releases;
/