fix push gitlab

This commit is contained in:
mrT23
2024-09-13 20:59:45 +03:00
parent 867a430a38
commit 0fb158fd47

View File

@ -173,7 +173,7 @@ async def gitlab_webhook(background_tasks: BackgroundTasks, request: Request):
# ignore bot users
if is_bot_user(data):
return JSONResponse(status_code=status.HTTP_200_OK, content=jsonable_encoder({"message": "success"}))
if data.get('event_type') != 'note': # not a comment
if data.get('event_type') != 'note' and data.get('object_attributes', {}): # not a comment
# ignore MRs based on title, labels, source and target branches
if not should_process_pr_logic(data, data['object_attributes'].get('title')):
return JSONResponse(status_code=status.HTTP_200_OK, content=jsonable_encoder({"message": "success"}))