From 9a10feefbd3f6d57fcff286e8e2c2cb4f757f695 Mon Sep 17 00:00:00 2001 From: jimmy Date: Tue, 25 May 2021 03:23:27 +0000 Subject: [PATCH] Check branch --- src/main.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main.py b/src/main.py index 334ba34..ac2b04e 100644 --- a/src/main.py +++ b/src/main.py @@ -16,13 +16,15 @@ class App: json = await request.json() text = await request.read() header_signature = request.headers.get('X-Hub-Signature') - if (status := self.verify_signature(text, header_signature)) == 200: - self.pack.pull() - self.pack.collate() - self.pack.compress() - self.pack.hash() - print(status) - return web.Response(status=status) + print("Hook recieved") + if "ref" in json and json["ref"] == 'refs/heads/release': + if (status := self.verify_signature(text, header_signature)) == 200: + self.pack.pull() + self.pack.collate() + self.pack.compress() + self.pack.hash() + print(status) + return web.Response(status=200) def verify_signature(self, request_data, header_signature): # do not store your secret key in your code, pull from environment variable