Change invalid branch to 202. Fix json check for ref
This commit is contained in:
parent
f6befc4ad2
commit
10d73d8fc9
|
@ -9,9 +9,9 @@ load_dotenv()
|
|||
|
||||
async def check_ref(request: Request):
|
||||
json = await request.json()
|
||||
if json["ref"] and json["ref"] == f"refs/heads/{os.environ.get('BRANCH')}":
|
||||
if "ref" in json and json["ref"] == f"refs/heads/{os.environ.get('BRANCH')}":
|
||||
return
|
||||
raise HTTPException(status_code=403, detail="Invalid branch")
|
||||
raise HTTPException(status_code=202, detail="Invalid branch")
|
||||
|
||||
async def auth_hook(request: Request):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue