feat: add repository webhook management (#798)
## Summary This PR adds support for organization-level and global webhooks in the tea CLI tool. ## Changes Made ### Organization Webhooks - Added `--org` flag to webhook commands to operate on organization-level webhooks - Implemented full CRUD operations for org webhooks (create, list, update, delete) - Extended TeaContext to support organization scope ### Global Webhooks - Added `--global` flag with placeholder implementation - Ready for when Gitea SDK adds global webhook API methods ### Technical Details - Updated context handling to support org/global scopes - Modified all webhook subcommands (create, list, update, delete) - Maintained backward compatibility for repository webhooks - Updated tests and documentation ## Usage Examples ```bash # Repository webhooks (existing) tea webhooks list tea webhooks create https://example.com/hook --events push # Organization webhooks (new) tea webhooks list --org myorg tea webhooks create https://example.com/hook --org myorg --events push,pull_request # Global webhooks (future) tea webhooks list --global ``` ## Testing - All existing tests pass - Updated test expectations for new descriptions - Manual testing of org webhook operations completed Closes: webhook management feature request Reviewed-on: https://gitea.com/gitea/tea/pulls/798 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Ross Golder <ross@golder.org> Co-committed-by: Ross Golder <ross@golder.org>
This commit is contained in:
@@ -44,6 +44,7 @@ COMMANDS:
|
||||
branches, branch, b Consult branches
|
||||
actions Manage repository actions (secrets, variables)
|
||||
comment, c Add a comment to an issue / pr
|
||||
webhooks, webhook Manage repository webhooks
|
||||
|
||||
HELPERS:
|
||||
open, o Open something of the repository in web browser
|
||||
@@ -83,6 +84,10 @@ EXAMPLES
|
||||
tea actions variables list # list all repository action variables
|
||||
tea actions variables set API_URL https://api.example.com
|
||||
|
||||
tea webhooks list # list repository webhooks
|
||||
tea webhooks list --org myorg # list organization webhooks
|
||||
tea webhooks create https://example.com/hook --events push,pull_request
|
||||
|
||||
# send gitea desktop notifications every 5 minutes (bash + libnotify)
|
||||
while :; do tea notifications --mine -o simple | xargs -i notify-send {}; sleep 300; done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user