Skip to content

Commit 0323f3c

Browse files
committed
fixes #184
1 parent 2093545 commit 0323f3c

File tree

9 files changed

+81
-58
lines changed

9 files changed

+81
-58
lines changed

00_core.ipynb

Lines changed: 56 additions & 48 deletions
Large diffs are not rendered by default.

ghapi/_modidx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
'ghapi.core._GhVerbGroup.__init__': ('core.html#_ghverbgroup.__init__', 'ghapi/core.py'),
8282
'ghapi.core._GhVerbGroup.__str__': ('core.html#_ghverbgroup.__str__', 'ghapi/core.py'),
8383
'ghapi.core._GhVerbGroup._repr_markdown_': ('core.html#_ghverbgroup._repr_markdown_', 'ghapi/core.py'),
84+
'ghapi.core._decode_response': ('core.html#_decode_response', 'ghapi/core.py'),
8485
'ghapi.core._mk_param': ('core.html#_mk_param', 'ghapi/core.py'),
8586
'ghapi.core._mk_sig': ('core.html#_mk_sig', 'ghapi/core.py'),
8687
'ghapi.core._mk_sig_detls': ('core.html#_mk_sig_detls', 'ghapi/core.py'),

ghapi/actions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Functionality for helping to create GitHub Actions workflows in Python"""
2+
13
# AUTOGENERATED! DO NOT EDIT! File to edit: ../01_actions.ipynb.
24

35
# %% auto 0

ghapi/auth.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Helpers for creating GitHub API tokens"""
2+
13
# AUTOGENERATED! DO NOT EDIT! File to edit: ../02_auth.ipynb.
24

35
# %% auto 0

ghapi/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Access to the GitHub API from the command line"""
2+
13
# AUTOGENERATED! DO NOT EDIT! File to edit: ../10_cli.ipynb.
24

35
# %% auto 0

ghapi/core.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Detailed information on the GhApi API"""
2+
13
# AUTOGENERATED! DO NOT EDIT! File to edit: ../00_core.ipynb.
24

35
# %% auto 0
@@ -250,32 +252,34 @@ def get_content(self:GhApi, path):
250252

251253
# %% ../00_core.ipynb 108
252254
@patch
253-
def create_or_update_file(self:GhApi, path, message=None, content=None,
254-
sha=None, branch=None, committer=None, author=None):
255+
def create_or_update_file(self:GhApi, path, message, committer, author, content=None, sha=None, branch=''):
256+
if not branch: branch = api.repos.get()['default_branch']
255257
if not isinstance(content,bytes): content = content.encode()
256258
content = base64.b64encode(content).decode()
257259
kwargs = {'sha':sha} if sha else {}
258260
return self.repos.create_or_update_file_contents(path, message, content=content,
259-
branch=branch, committer=committer, author=author, **kwargs)
261+
branch=branch, committer=committer or {}, author=author or {}, **kwargs)
260262

261263
# %% ../00_core.ipynb 109
262264
@patch
263-
def create_file(self:GhApi, path, message, content=None, branch=None, committer=None, author=None):
264-
return self.create_or_update_file(path, message, content, branch=branch, committer=committer, author=author)
265+
def create_file(self:GhApi, path, message, committer, author, content=None, branch=None):
266+
if not branch: branch = api.repos.get()['default_branch']
267+
return self.create_or_update_file(path, message, branch=branch, committer=committer, content=content, author=author)
265268

266269
# %% ../00_core.ipynb 111
267270
@patch
268-
def delete_file(self:GhApi, path, message, sha=None, branch=None, committer=None, author=None):
271+
def delete_file(self:GhApi, path, message, committer, author, sha=None, branch=None):
272+
if not branch: branch = api.repos.get()['default_branch']
269273
if sha is None: sha = self.list_files()[path].sha
270274
return self.repos.delete_file(path, message=message, sha=sha,
271275
branch=branch, committer=committer, author=author)
272276

273277
# %% ../00_core.ipynb 113
274278
@patch
275-
def update_contents(self:GhApi, path, message, content, sha=None, branch=None, committer=None, author=None):
279+
def update_contents(self:GhApi, path, message, committer, author, content, sha=None, branch=None):
280+
if not branch: branch = api.repos.get()['default_branch']
276281
if sha is None: sha = self.list_files()[path].sha
277-
return self.create_or_update_file(path, message, content,
278-
sha=sha, branch=branch, committer=committer, author=author)
282+
return self.create_or_update_file(path, message, committer=committer, author=author, content=content, sha=sha, branch=branch)
279283

280284
# %% ../00_core.ipynb 117
281285
@patch

ghapi/event.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Helpers for getting GitHub API events"""
2+
13
# AUTOGENERATED! DO NOT EDIT! File to edit: ../04_event.ipynb.
24

35
# %% auto 0

ghapi/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'security-advisories/list-global-advisories',
55
'List global security advisories',
66
'rest/security-advisories/global-advisories#list-global-security-advisories',
7-
['ghsa_id', 'type', 'cve_id', 'ecosystem', 'severity', 'cwes', 'is_withdrawn', 'affects', 'published', 'updated', 'modified', 'before', 'after', 'direction', 'per_page', 'sort'],
7+
['ghsa_id', 'type', 'cve_id', 'ecosystem', 'severity', 'cwes', 'is_withdrawn', 'affects', 'published', 'updated', 'modified', 'epss_percentage', 'epss_percentile', 'before', 'after', 'direction', 'per_page', 'sort'],
88
[],
99
''),
1010
('/advisories/{ghsa_id}', 'get', 'security-advisories/get-global-advisory', 'Get a global security advisory', 'rest/security-advisories/global-advisories#get-a-global-security-advisory', [], [], ''),

ghapi/page.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Parallel and serial pagination"""
2+
13
# AUTOGENERATED! DO NOT EDIT! File to edit: ../03_page.ipynb.
24

35
# %% auto 0

0 commit comments

Comments
 (0)