🪝 A GitHub CLI extension to easily manage your repository webhooks.
- Create a repository webhook
- Delete one or more repository webhooks
- List all repository webhooks
- Install the
gh
CLI (requires v2.0.0 at a minimum). - Install this extension:
gh extension install lucasmelin/gh-hook
Run using gh hook
. Run gh hook --help
for more info.
By default, this extension will prompt for all the information needed to create a webhook when run with gh hook create
. However, the --file
flag allows for passing the webhook data via a JSON file instead, if you prefer:
$ cat hook.json
{
"active": true,
"events": [
"push",
"pull_request"
],
"config": {
"url": "https://example.com",
"content_type": "json",
"insecure_ssl": "0",
"secret": "somesecretpassphrase"
}
}
$ gh hook create --file hook.json
Creating new webhook for gh-hook
Successfully created hook 🪝
$ gh hook list
✓ 404339664 - https://example.com (pull_request, push)
# Install the action locally
gh extension install .; gh hook
# View changes
go build && gh hook