mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 01:05:26 +01:00 
			
		
		
		
	feat: add actions management commands (#796)
## Summary This PR adds comprehensive Actions secrets and variables management functionality to the tea CLI, enabling users to manage their repository's CI/CD configuration directly from the command line. ## Features Added ### Actions Secrets Management - **List secrets**: `tea actions secrets list` - Display all repository action secrets - **Create secrets**: `tea actions secrets create <name>` - Create new secrets with interactive prompts - **Delete secrets**: `tea actions secrets delete <name>` - Remove existing secrets ### Actions Variables Management - **List variables**: `tea actions variables list` - Display all repository action variables - **Set variables**: `tea actions variables set <name> <value>` - Create or update variables - **Delete variables**: `tea actions variables delete <name>` - Remove existing variables ## Implementation Details - **Interactive prompts**: Secure input handling for sensitive secret values - **Input validation**: Proper validation for secret/variable names and values - **Table formatting**: Consistent output formatting with existing tea commands - **Error handling**: Comprehensive error handling and user feedback - **Test coverage**: Full test suite for all functionality ## Usage Examples ```bash # Secrets management tea actions secrets list tea actions secrets create API_KEY # Will prompt securely for value tea actions secrets delete OLD_SECRET # Variables management tea actions variables list tea actions variables set API_URL https://api.example.com tea actions variables delete UNUSED_VAR ``` ## Related Issue Resolves #797 ## Testing - All new functionality includes comprehensive unit tests - Integration with existing tea CLI patterns and conventions - Validated against Gitea Actions API Reviewed-on: https://gitea.com/gitea/tea/pulls/796 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:
		
							
								
								
									
										104
									
								
								docs/CLI.md
									
									
									
									
									
								
							
							
						
						
									
										104
									
								
								docs/CLI.md
									
									
									
									
									
								
							| @@ -1269,6 +1269,110 @@ Unprotect branches | ||||
|  | ||||
| **--repo, -r**="": Override local repository path or gitea repository slug to interact with. Optional | ||||
|  | ||||
| ## actions, action | ||||
|  | ||||
| Manage repository actions | ||||
|  | ||||
| **--login**="": gitea login instance to use | ||||
|  | ||||
| **--output, -o**="": output format [table, csv, simple, tsv, yaml, json] | ||||
|  | ||||
| **--repo**="": repository to operate on | ||||
|  | ||||
| ### secrets, secret | ||||
|  | ||||
| Manage repository action secrets | ||||
|  | ||||
| #### list, ls | ||||
|  | ||||
| List action secrets | ||||
|  | ||||
| **--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, add, set | ||||
|  | ||||
| Create an action secret | ||||
|  | ||||
| **--file**="": read secret value from file | ||||
|  | ||||
| **--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 | ||||
|  | ||||
| **--stdin**: read secret value from stdin | ||||
|  | ||||
| #### delete, remove, rm | ||||
|  | ||||
| Delete an action secret | ||||
|  | ||||
| **--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 | ||||
|  | ||||
| ### variables, variable, vars, var | ||||
|  | ||||
| Manage repository action variables | ||||
|  | ||||
| #### list, ls | ||||
|  | ||||
| List action variables | ||||
|  | ||||
| **--login, -l**="": Use a different Gitea Login. Optional | ||||
|  | ||||
| **--name**="": show specific variable by name | ||||
|  | ||||
| **--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 | ||||
|  | ||||
| #### set, create, update | ||||
|  | ||||
| Set an action variable | ||||
|  | ||||
| **--file**="": read variable value from file | ||||
|  | ||||
| **--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 | ||||
|  | ||||
| **--stdin**: read variable value from stdin | ||||
|  | ||||
| #### delete, remove, rm | ||||
|  | ||||
| Delete an action variable | ||||
|  | ||||
| **--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 | ||||
|  | ||||
| ## comment, c | ||||
|  | ||||
| Add a comment to an issue / pr | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ross Golder
					Ross Golder