mirror of
				https://git.ferricyanide.solutions/A_D/irc-webhooks.git
				synced 2025-10-31 06:40:54 +00:00 
			
		
		
		
	made sure to dump unknown events for use later
This commit is contained in:
		
							parent
							
								
									799c07d43a
								
							
						
					
					
						commit
						5e542379cf
					
				
							
								
								
									
										12
									
								
								webhooks.go
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								webhooks.go
									
									
									
									
									
								
							| @ -112,14 +112,24 @@ func handleWebHook(writer http.ResponseWriter, request *http.Request) { | |||||||
| 
 | 
 | ||||||
|     default: |     default: | ||||||
|         fmt.Printf("Unknown event type: %q\n", eventType) |         fmt.Printf("Unknown event type: %q\n", eventType) | ||||||
|  |         handleUnknown(data) | ||||||
|         return |         return | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | func printSep() { | ||||||
|  |     fmt.Println("---") | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func handleUnknown(data []byte) { | ||||||
|  |     printSep() | ||||||
|  |     fmt.Println(string(data)) | ||||||
|  | } | ||||||
|  | 
 | ||||||
| func handlePush(data []byte) { | func handlePush(data []byte) { | ||||||
|  |     printSep() | ||||||
|     pushData := Push{} |     pushData := Push{} | ||||||
|     json.Unmarshal(data, &pushData) |     json.Unmarshal(data, &pushData) | ||||||
|     fmt.Println("---") |  | ||||||
|     fmt.Printf( |     fmt.Printf( | ||||||
|         "Got a push for repo %q owned by %q. Pushed by %q (%q)\n", |         "Got a push for repo %q owned by %q. Pushed by %q (%q)\n", | ||||||
|         pushData.Repository.FullName, |         pushData.Repository.FullName, | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user