Add back owner check

This commit is contained in:
ludeeus
2020-07-03 21:15:15 +02:00
parent fc158841a9
commit d7359ccdbb
+5 -1
View File
@@ -14,6 +14,10 @@ async def check():
event = get_event() event = get_event()
actor = event["pull_request"]["user"]["login"] actor = event["pull_request"]["user"]["login"]
if repo.split("/")[0] == actor:
print(f"'{actor}' is the owner of '{repo}'")
return
try: try:
async with GitHub(TOKEN) as github: async with GitHub(TOKEN) as github:
request = await github.client.get( request = await github.client.get(
@@ -35,7 +39,7 @@ async def check():
if [x["contributions"] for x in _sorted if x["login"] == actor].pop() > ( if [x["contributions"] for x in _sorted if x["login"] == actor].pop() > (
_top / 2 _top / 2
): ):
print(f"{actor} is a major contributor to '{repo}'") print(f"'{actor}' is a major contributor to '{repo}'")
return return
except AIOGitHubAPIException as e: except AIOGitHubAPIException as e:
exit(f"::error::{e}") exit(f"::error::{e}")