8000 GitHub - rjz/githubhook at 9299dde1055205be21e93f87d2720051e5774b51
[go: up one dir, main page]

Skip to content

rjz/githubhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

githubhook

Golang parser for github webhooks. Not a server, though it could be integrated with one.

Installation

$ go get github.com/rjz/githubhook

Usage

Given an incoming *http.Request representing a webhook signed with a secret, use githubhook to validate and parse its content:

secret := []byte("don't tell!")
hook, err := githubhook.Parse(secret, req)

Plays nicely with the google/go-github client!

evt := github.PullRequestEvent{}
if err := json.Unmarshal(hook.Payload, &evt); err != nil {
  fmt.Println("Invalid JSON?", err)
}

About

Github webhook parser in golang

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0