From 437a7ec1229f997c219ff2fcd87750180f74eced Mon Sep 17 00:00:00 2001 From: aarizona Date: Thu, 2 May 2024 12:19:03 +0300 Subject: [PATCH] add request webhook --- app/main.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 6a78824..10193a6 100644 --- a/app/main.py +++ b/app/main.py @@ -16,5 +16,13 @@ async def intgr(request: Request): ref = body["ref"] branch = ref.split('/')[-1] [tag, number, *args] = branch.split('-') - logger.info(f"{tag} {number} {args}") + logger.info(f"tag {tag} number {number} args {args}") + + if number == 'test': + number = 423 + + request.get( + "https://crm.svs-tech.pro/rest/38/7ufrqnfpncmt279p/task.commentitem.add.json?" + f"taskId={number}&fields[POST_MESSAGE]=f'{body['commits'][0]['message']}'" + ) return {"status": "success"}