Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 878 Bytes

README.md

File metadata and controls

38 lines (29 loc) · 878 Bytes

ghwebhook

USAGE

package main

import (
	"log"
	"net/http"

	"github.com/google/go-github/github"
	"github.com/shogo82148/ghwebhook"
)

func main() {
	h := &ghwebhook.Webhook{
		// recommend to set secret
		Secret:       "very-secret-string",

		// Restrict IP address
		RestrictAddr: true,
		TrustAddrs:   []string{"::1/128", "127.0.0.0/8"},

		Ping: func(e *github.PingEvent) {
			log.Printf("%#v", e)
		},
	}
	http.ListenAndServe(":8080", h)
}

Related Projects