Skip to content

Commit

Permalink
Ignore forbidden
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Dec 22, 2020
1 parent c4aef28 commit e165d12
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions helpers/post_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@ async def post():
_endpoint = f"{BASE_API_URL}/repos/{name}/issues/comments/{comment['id']}"
result = await github.client.session.patch(_endpoint, json={"body": msg}, headers=_headers)
if result.status != 200:
print(_endpoint)
print(result.reason)
exit(1)
if result.reason != "Forbidden":
print(_endpoint)
print(result.reason)
exit(1)
return

result = await github.client.session.post(_endpoint, json={"body": msg}, headers=_headers)
if result.status != 201:
print(_endpoint)
print(result.reason)
exit(1)
if result.reason != "Forbidden":
print(_endpoint)
print(result.reason)
exit(1)


asyncio.get_event_loop().run_until_complete(post())

0 comments on commit e165d12

Please sign in to comment.