From c3622334cc776f93844ba1932e526bb6a7f5d742 Mon Sep 17 00:00:00 2001 From: imvipindev Date: Mon, 21 Aug 2023 20:07:55 +0530 Subject: [PATCH] fix: :bug: Fixed Webhook Issues --- github/endpoints/githubEndpoints.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/github/endpoints/githubEndpoints.ts b/github/endpoints/githubEndpoints.ts index 3f15b72..c2f25ba 100644 --- a/github/endpoints/githubEndpoints.ts +++ b/github/endpoints/githubEndpoints.ts @@ -51,18 +51,18 @@ export class githubWebHooks extends ApiEndpoint { } const eventCaps = event.toUpperCase(); let messageText = "newEvent !"; - + console.log(payload) if (event == "push") { messageText = `*New Commits to* *[${payload.repository.full_name}](${payload.repository.html_url}) by ${payload.pusher.name}*`; } else if (event == "pull_request") { if(payload.action == "opened"){ - messageText = `*[New Pull Request](${payload.pull_request.html_url})* *|* *#${payload.pull_request.number} ${payload.pull_request.title}* by *[${payload.user.login}](${payload.user.html_url})* *|* *[${payload.repository.full_name}]*`; + messageText = `*[New Pull Request](${payload.pull_request.html_url})* *|* *#${payload.pull_request.number} ${payload.pull_request.title}* by *[${payload.pull_request.user.login}](${payload.pull_request.user.html_url})* *|* *[${payload.repository.full_name}]*`; }else if(payload.action == "closed" && payload.pull_request.merged ){ - messageText = `*[Merged Pull Request](${payload.pull_request.html_url})* *|* *#${payload.pull_request.number} ${payload.pull_request.title}* by *[${payload.user.login}](${payload.user.html_url})* *|* *[${payload.repository.full_name}]*`; + messageText = `*[Merged Pull Request](${payload.pull_request.html_url})* *|* *#${payload.pull_request.number} ${payload.pull_request.title}* by *[${payload.pull_request.user.login}](${payload.pull_request.user.html_url})* *|* *[${payload.repository.full_name}]*`; }else if(payload.action == "closed" && !payload.pull_request.merged){ - messageText = `*[Closed Pull Request](${payload.pull_request.html_url})* *|* *#${payload.pull_request.number} ${payload.pull_request.title}* by *[${payload.user.login}](${payload.user.html_url})* *|* *[${payload.repository.full_name}]*`; + messageText = `*[Closed Pull Request](${payload.pull_request.html_url})* *|* *#${payload.pull_request.number} ${payload.pull_request.title}* by *[${payload.pull_request.user.login}](${payload.pull_request.user.html_url})* *|* *[${payload.repository.full_name}]*`; }else if(payload.action =="reopened"){ - messageText = `*[ReOpened Pull Request](${payload.pull_request.html_url})* *|* *#${payload.pull_request.number} ${payload.pull_request.title}* by *[${payload.user.login}](${payload.user.html_url})* *|* *[${payload.repository.full_name}]*`; + messageText = `*[ReOpened Pull Request](${payload.pull_request.html_url})* *|* *#${payload.pull_request.number} ${payload.pull_request.title}* by *[${payload.pull_request.user.login}](${payload.pull_request.user.html_url})* *|* *[${payload.repository.full_name}]*`; }else{ return this.success(); } @@ -106,3 +106,6 @@ export class githubWebHooks extends ApiEndpoint { return this.success(); } } + + +