Check branch
This commit is contained in:
16
src/main.py
16
src/main.py
@@ -16,13 +16,15 @@ class App:
|
|||||||
json = await request.json()
|
json = await request.json()
|
||||||
text = await request.read()
|
text = await request.read()
|
||||||
header_signature = request.headers.get('X-Hub-Signature')
|
header_signature = request.headers.get('X-Hub-Signature')
|
||||||
if (status := self.verify_signature(text, header_signature)) == 200:
|
print("Hook recieved")
|
||||||
self.pack.pull()
|
if "ref" in json and json["ref"] == 'refs/heads/release':
|
||||||
self.pack.collate()
|
if (status := self.verify_signature(text, header_signature)) == 200:
|
||||||
self.pack.compress()
|
self.pack.pull()
|
||||||
self.pack.hash()
|
self.pack.collate()
|
||||||
print(status)
|
self.pack.compress()
|
||||||
return web.Response(status=status)
|
self.pack.hash()
|
||||||
|
print(status)
|
||||||
|
return web.Response(status=200)
|
||||||
|
|
||||||
def verify_signature(self, request_data, header_signature):
|
def verify_signature(self, request_data, header_signature):
|
||||||
# do not store your secret key in your code, pull from environment variable
|
# do not store your secret key in your code, pull from environment variable
|
||||||
|
Reference in New Issue
Block a user