mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 01:05:26 +01:00 
			
		
		
		
	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:
		
							
								
								
									
										98
									
								
								docs/CLI.md
									
									
									
									
									
								
							
							
						
						
									
										98
									
								
								docs/CLI.md
									
									
									
									
									
								
							| @@ -1373,6 +1373,104 @@ Delete an action variable | ||||
|  | ||||
| **--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional | ||||
|  | ||||
| ## webhooks, webhook, hooks, hook | ||||
|  | ||||
| Manage webhooks | ||||
|  | ||||
| **--global**: operate on global webhooks | ||||
|  | ||||
| **--login**="": gitea login instance to use | ||||
|  | ||||
| **--login, -l**="": Use a different Gitea Login. Optional | ||||
|  | ||||
| **--org**="": organization to operate on | ||||
|  | ||||
| **--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) | ||||
|  | ||||
| **--output, -o**="": output format [table, csv, simple, tsv, yaml, json] | ||||
|  | ||||
| **--remote, -R**="": Discover Gitea login from remote. Optional | ||||
|  | ||||
| **--repo**="": repository to operate on | ||||
|  | ||||
| **--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional | ||||
|  | ||||
| ### list, ls | ||||
|  | ||||
| List webhooks | ||||
|  | ||||
| **--login, -l**="": Use a different Gitea Login. Optional | ||||
|  | ||||
| **--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) | ||||
|  | ||||
| **--remote, -R**="": Discover Gitea login from remote. Optional | ||||
|  | ||||
| **--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional | ||||
|  | ||||
| ### create, c | ||||
|  | ||||
| Create a webhook | ||||
|  | ||||
| **--active**: webhook is active | ||||
|  | ||||
| **--authorization-header**="": authorization header | ||||
|  | ||||
| **--branch-filter**="": branch filter for push events | ||||
|  | ||||
| **--events**="": comma separated list of events (default: push) | ||||
|  | ||||
| **--login, -l**="": Use a different Gitea Login. Optional | ||||
|  | ||||
| **--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) | ||||
|  | ||||
| **--remote, -R**="": Discover Gitea login from remote. Optional | ||||
|  | ||||
| **--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional | ||||
|  | ||||
| **--secret**="": webhook secret | ||||
|  | ||||
| **--type**="": webhook type (gitea, gogs, slack, discord, dingtalk, telegram, msteams, feishu, wechatwork, packagist) (default: gitea) | ||||
|  | ||||
| ### delete, rm | ||||
|  | ||||
| Delete a webhook | ||||
|  | ||||
| **--confirm, -y**: confirm deletion without prompting | ||||
|  | ||||
| **--login, -l**="": Use a different Gitea Login. Optional | ||||
|  | ||||
| **--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) | ||||
|  | ||||
| **--remote, -R**="": Discover Gitea login from remote. Optional | ||||
|  | ||||
| **--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional | ||||
|  | ||||
| ### update, edit, u | ||||
|  | ||||
| Update a webhook | ||||
|  | ||||
| **--active**: webhook is active | ||||
|  | ||||
| **--authorization-header**="": authorization header | ||||
|  | ||||
| **--branch-filter**="": branch filter for push events | ||||
|  | ||||
| **--events**="": comma separated list of events | ||||
|  | ||||
| **--inactive**: webhook is inactive | ||||
|  | ||||
| **--login, -l**="": Use a different Gitea Login. Optional | ||||
|  | ||||
| **--output, -o**="": Output format. (simple, table, csv, tsv, yaml, json) | ||||
|  | ||||
| **--remote, -R**="": Discover Gitea login from remote. Optional | ||||
|  | ||||
| **--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional | ||||
|  | ||||
| **--secret**="": webhook secret | ||||
|  | ||||
| **--url**="": webhook URL | ||||
|  | ||||
| ## comment, c | ||||
|  | ||||
| Add a comment to an issue / pr | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ross Golder
					Ross Golder