mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-06 05:40:38 +08:00
feat: gitlab skip source, target and labels
This commit is contained in:
@ -132,10 +132,9 @@ async def gitlab_webhook(background_tasks: BackgroundTasks, request: Request):
|
|||||||
draft = data['object_attributes'].get('draft')
|
draft = data['object_attributes'].get('draft')
|
||||||
source_branch = data['object_attributes'].get('source_branch')
|
source_branch = data['object_attributes'].get('source_branch')
|
||||||
target_branch = data['object_attributes'].get('target_branch')
|
target_branch = data['object_attributes'].get('target_branch')
|
||||||
labels = data['object_attributes'].get('labels').map(lambda x: x['title'])
|
labels = [label['title'] for label in data['object_attributes'].get('labels', [])]
|
||||||
|
|
||||||
get_logger().info(f"New merge request: {url}")
|
get_logger().info(f"New merge request: {url}")
|
||||||
|
|
||||||
if target_branch in excluded_target_branches or source_branch in excluded_source_branches:
|
if target_branch in excluded_target_branches or source_branch in excluded_source_branches:
|
||||||
get_logger().info(f"Skipping excluded branch MR: {url}")
|
get_logger().info(f"Skipping excluded branch MR: {url}")
|
||||||
return JSONResponse(status_code=status.HTTP_200_OK, content=jsonable_encoder({"message": "success"}))
|
return JSONResponse(status_code=status.HTTP_200_OK, content=jsonable_encoder({"message": "success"}))
|
||||||
|
Reference in New Issue
Block a user