-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_test.py
More file actions
30 lines (25 loc) · 766 Bytes
/
Copy pathdebug_test.py
File metadata and controls
30 lines (25 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python3
import requests
import json
def debug_webhook():
# Use the sample webhook data
# Use real repository payload
payload = {
"ref": "refs/heads/main",
"after": "main",
"repository": {
"clone_url": "https://github.com/octocat/Hello-World.git"
},
"commits": [{"message": "Test CI pipeline"}]
}
print("Sending webhook...")
print(f"Payload: {json.dumps(payload, indent=2)}")
response = requests.post(
'http://localhost:8080/webhook',
json=payload,
headers={'Content-Type': 'application/json'}
)
print(f"Status: {response.status_code}")
print(f"Response: {response.text}")
if __name__ == "__main__":
debug_webhook()