nikhmr1235 commited on
Commit
b22918d
·
verified ·
1 Parent(s): 13c4d84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -90,6 +90,12 @@ async def github_webhook(
90
  """
91
  # Ensure it's a pull_request event first
92
  print("/webhook triggered successfully")
 
 
 
 
 
 
93
  if x_github_event != "pull_request":
94
  print(f"Received non-pull_request event: {x_github_event}. Skipping.")
95
  return {"message": f"Event type '{x_github_event}' ignored."}
 
90
  """
91
  # Ensure it's a pull_request event first
92
  print("/webhook triggered successfully")
93
+
94
+ # Handle ping event separately
95
+ if x_github_event == "ping":
96
+ print("Received GitHub 'ping' event. Webhook is active.")
97
+ return {"message": "pong"} # Or any success message
98
+
99
  if x_github_event != "pull_request":
100
  print(f"Received non-pull_request event: {x_github_event}. Skipping.")
101
  return {"message": f"Event type '{x_github_event}' ignored."}