Skip to content

Commit

Permalink
Change: Update github CLI to use new pull requests API
Browse files Browse the repository at this point in the history
api.pulls is deprecated and api.pull_requests should be used instead.
  • Loading branch information
bjoernricks committed Mar 8, 2023
1 parent 446b492 commit dd7d594
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pontos/github/cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def create_pull_request(terminal: Terminal, args: Namespace):

terminal.ok(f"Target branch {args.target} exists.")

await api.pulls.create(
await api.pull_requests.create(
repo=args.repo,
head_branch=args.head,
base_branch=args.target,
Expand Down Expand Up @@ -154,7 +154,7 @@ async def update_pull_request(terminal: Terminal, args: Namespace):

terminal.ok(f"Target branch {args.target} exists.")

await api.pulls.update(
await api.pull_requests.update(
repo=args.repo,
pull_request=args.pull_request,
base_branch=args.target,
Expand All @@ -172,7 +172,7 @@ async def file_status(terminal: Terminal, args: Namespace):
async with GitHubAsyncRESTApi(token=args.token) as api:
try:
# check if PR is existing
exists = await api.pulls.exists(
exists = await api.pull_requests.exists(
repo=args.repo, pull_request=args.pull_request
)
if not exists:
Expand All @@ -184,7 +184,7 @@ async def file_status(terminal: Terminal, args: Namespace):

terminal.ok(f"PR {args.pull_request} exists.")

file_dict = await api.pulls.files(
file_dict = await api.pull_requests.files(
repo=args.repo,
pull_request=args.pull_request,
status_list=args.status,
Expand All @@ -208,7 +208,7 @@ async def labels(terminal: Terminal, args: Namespace):
async with GitHubAsyncRESTApi(token=args.token) as api:
try:
# check if PR is existing
exists = await api.pulls.exists(
exists = await api.pull_requests.exists(
repo=args.repo, pull_request=args.issue
)
if not exists:
Expand Down

0 comments on commit dd7d594

Please sign in to comment.