5 using Microsoft.AspNet.WebHooks;
6 using Newtonsoft.Json.Linq;
8 using System.Diagnostics;
11 using System.Threading.Tasks;
13 namespace CPE.App.Api.WebHooks
15 public class GitHubWebHookHandler : WebHookHandler
17 public GitHubWebHookHandler()
19 this.Receiver = "github";
22 public override Task ExecuteAsync(string receiver, WebHookHandlerContext context)
24 string action = context.Actions.First();
25 JObject data = context.GetDataOrDefault<JObject>();
27 Debug.WriteLine("Made it to reciever");
28 TextWriter writer = null;
31 var contentsToWriteToFile = data;
32 writer = new StreamWriter("C:/bitbucket/githubWebhookdata.txt", false);
33 writer.Write(contentsToWriteToFile);
41 return Task.FromResult(true);