gt-webhook-create1
Create a webhook
Usage
gt webhook
create
[<url>]
[flags]
Overview
Create a webhook that delivers events to a URL, by default as JSON for push events.
Events: create, delete, fork, push, issues, issues_only, issue_assign, issue_label, issue_milestone, issue_comment, pull_request, pull_request_only, pull_request_assign, pull_request_label, pull_request_milestone, pull_request_comment, pull_request_review, pull_request_sync, pull_request_review_request, wiki, repository, release, package, status, workflow_run, workflow_job; issues and pull_request include every issue or pull request event.
Types: gitea, gogs, slack, discord, dingtalk, telegram, msteams, feishu, matrix, wechatwork, packagist. Slack webhooks need --config channel=#name (username, icon_url and color are optional). Gitea reads no other settings from --config, so set up discord, matrix and packagist webhooks in the web UI.
Json fields
active, branch_filter, content_type, created_at, events, id, type, updated_at, url
Options
--active[=true]
Deliver events (use --active=false to create the webhook paused)
--authorization-header=""
Authorization value (prefer file input)
--authorization-header-file=""
Read authorization value from file or -
--branch-filter=""
Branch glob for push events
--clear-authorization[=false]
Send no authorization header; on edit, this removes the stored one
--config=[]
Adapter-specific configuration, for example channel=alerts
--events=[push]
Events that trigger the webhook, comma-separated
-h, --help[=false]
help for create
--secret=""
Signing secret (prefer --secret-file)
--secret-file=""
Read signing secret from file or -
--type="gitea"
Webhook adapter type {gitea|gogs|slack|discord|dingtalk|telegram|msteams|feishu|matrix|wechatwork|packagist}
--url=""
Delivery URL
Options inherited from parent commands
--account[=false]
Manage the webhooks of your account
--csv[=""]
Output CSV with the specified comma-separated fields, or all fields
--cwd=""
Working directory for repository discovery
--debug[=false]
Log the method, URL, status, and duration of each HTTP request to stderr
--global[=false]
Manage the system webhooks of the instance (administrators)
--host=""
Gitea instance URL, including any base path
--interactive[=false]
Allow prompts with machine output
-q, --jq=""
Filter JSON output using a jq expression; implies --json
--json[=""]
Output JSON with the specified comma-separated fields, or all fields
--no-input[=false]
Disable prompts and implicit editor/browser interactions
--org=""
Manage the webhooks of an organization
--remote=""
Git remote used for repository discovery
-R, --repo=""
Select a repository as OWNER/REPO or URL
--sudo=""
Perform API requests as this user (requires an administrator account)
--user=""
Account name on the selected instance
Examples
$ gt webhook create https://ci.example.com/hooks/gitea --events push,pull_request # sign deliveries with a secret read from a file $ gt webhook create https://ci.example.com/hooks/gitea --secret-file secret.txt # notify a Slack channel about releases of an organization's repositories $ gt webhook create https://hooks.slack.com/services/T0/B0/X --org acme --type slack --config channel=#releases --events release