diff --git a/app/auth.py b/app/auth.py index dbf6b46..ac4e758 100644 --- a/app/auth.py +++ b/app/auth.py @@ -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: