Files
containers/webhook/webhook.py
Marco Verleun a44ebf38df
Some checks failed
Gitea Actions Demo Training / Explore-Gitea-Actions (push) Failing after 10s
test
2023-06-07 07:36:29 +02:00

22 lines
501 B
Python

import time
import os
import webhook_listener
def process_post_request(request, *args, **kwargs):
print(
"Recieved request:\n"
+ "Method: {}\n".format(request.method)
+ "Body: {}\n".format(request.body)
)
# Process request here
os.system('git pull')
os.system('ls -l ..')
return
webhooks = webhook_listener.Listener(handlers={"POST": process_post_request},logScreen=True)
webhooks.start()
while True:
print("Still alive....")
time.sleep(300)