mirror of
https://github.com/alexhopeoconnor/default.git
synced 2026-10-04 02:58:10 +10:00
Fix check
This commit is contained in:
+8
-11
@@ -14,19 +14,16 @@ async def check():
|
||||
event = get_event()
|
||||
actor = event["pull_request"]["user"]["login"]
|
||||
|
||||
try:
|
||||
async with GitHub(TOKEN) as github:
|
||||
request = await github.client.get(
|
||||
endpoint=f"/repos/{repo}/collaborators/{actor}/permission", headers={},
|
||||
)
|
||||
async with GitHub(TOKEN) as github:
|
||||
request = await github.client.get(
|
||||
endpoint=f"/repos/{repo}/collaborators/{actor}/permission", headers={},
|
||||
)
|
||||
|
||||
permission = request.get("permission", "read")
|
||||
permission = request.get("permission", "read")
|
||||
|
||||
if permission in ["admin", "write"]:
|
||||
print(f"{actor} is the owner of the repository")
|
||||
return
|
||||
except AIOGitHubAPIException as e:
|
||||
exit(f"::error::{e}")
|
||||
if permission in ["admin", "write"]:
|
||||
print(f"{actor} is the owner of the repository")
|
||||
return
|
||||
|
||||
exit(f"::error::{actor} does not have write access to the repository")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user