Check branch

This commit is contained in:
jimmy 2021-05-25 03:23:27 +00:00
parent 0fb19b1132
commit 9a10feefbd
1 changed files with 9 additions and 7 deletions

View File

@ -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