Check branch
This commit is contained in:
parent
0fb19b1132
commit
9a10feefbd
16
src/main.py
16
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
|
||||
|
|
Loading…
Reference in New Issue