mirror of
https://github.com/alexhopeoconnor/default.git
synced 2026-10-04 02:58:10 +10:00
Add back owner check
This commit is contained in:
@@ -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}")
|
||||||
|
|||||||
Reference in New Issue
Block a user