1
0
Fork 0
mirror of https://gitea.com/gitea/tea.git synced 2025-10-20 14:34:05 +02:00
tea/modules/print
Ross Golder 3495ec5ed4 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>
2025-10-19 03:40:23 +00:00
..
actions.go feat: add actions management commands (#796) 2025-10-19 02:53:17 +00:00
actions_test.go feat: add actions management commands (#796) 2025-10-19 02:53:17 +00:00
attachment.go Fix attachment size (#787) 2025-08-11 18:45:12 +00:00
branch.go tea branches list/protect/unprotect (#645) 2024-07-26 16:02:07 +00:00
comment.go spdx (#581) 2023-09-08 01:40:02 +00:00
formatters.go Fix attachment size (#787) 2025-08-11 18:45:12 +00:00
issue.go spdx (#581) 2023-09-08 01:40:02 +00:00
label.go spdx (#581) 2023-09-08 01:40:02 +00:00
login.go spdx (#581) 2023-09-08 01:40:02 +00:00
markdown.go spdx (#581) 2023-09-08 01:40:02 +00:00
milestone.go Use bubbletea instead of survey for interacting with TUI (#786) 2025-08-11 18:23:52 +00:00
notification.go spdx (#581) 2023-09-08 01:40:02 +00:00
organization.go spdx (#581) 2023-09-08 01:40:02 +00:00
pull.go spdx (#581) 2023-09-08 01:40:02 +00:00
release.go Add Zip URL for release list (#788) 2025-08-11 18:43:34 +00:00
repo.go spdx (#581) 2023-09-08 01:40:02 +00:00
table.go Fix yaml output single quote (#814) 2025-09-14 00:23:12 +00:00
table_test.go Fix yaml output single quote (#814) 2025-09-14 00:23:12 +00:00
times.go spdx (#581) 2023-09-08 01:40:02 +00:00
user.go spdx (#581) 2023-09-08 01:40:02 +00:00
webhook.go feat: add repository webhook management (#798) 2025-10-19 03:40:23 +00:00
webhook_test.go feat: add repository webhook management (#798) 2025-10-19 03:40:23 +00:00