This is a script for generating all_webhooks.go.
It does:
- Fetch the GitHub Docs HTML page
- Parse the HTML and find webhook names and their activity types from tables
- Generate mappings from webhook names to their activity types as a Go map variable
generate-webhook-events [[srcfile] dstfile]
Generate all_webhooks.go file:
go run ./scripts/generate-webhook-events ./all_webhooks.goWhen the HTML file is in local:
go run ./scripts/generate-webhook-events ./input.html ./all_webhooks.goFor debugging, specifying - to dstfile outputs the generated source to stdout:
go run ./scripts/generate-webhook-events ./input.html -Not applicableactivity types are generated as an empty slice:[]string{}Customactivity types are generated asnil- The output is sorted by webhook name so the generated file is stable