mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 06:21:11 +00:00 
			
		
		
		
	[CLI] implement forgejo-cli actions
(cherry picked from commit08be2b226e) (cherry picked from commitb6cfa88c6e) (cherry picked from commit59704200de) [CLI] implement forgejo-cli actions generate-secret (cherry picked from commit6f7905c8ec) (cherry picked from commite085d6d273) [CLI] implement forgejo-cli actions generate-secret (squash) NoInit (cherry picked from commit962c944eb2) [CLI] implement forgejo-cli actions register (cherry picked from commit2f95143000) (cherry picked from commit42f2f8731e) [CLI] implement forgejo-cli actions register (squash) no private Do not go through the private API, directly modify the database (cherry picked from commit1ba7c0d39d) [CLI] implement forgejo-cli actions (cherry picked from commit6f7905c8ec) (cherry picked from commite085d6d273) [CLI] implement forgejo-cli actions generate-secret (squash) NoInit (cherry picked from commit962c944eb2) (cherry picked from commit4c121ef022) Conflicts: cmd/forgejo/actions.go tests/integration/cmd_forgejo_actions_test.go (cherry picked from commit36997a48e3) [CLI] implement forgejo-cli actions (squash) restore --version Refs: https://codeberg.org/forgejo/forgejo/issues/1134 (cherry picked from commit9739eb52d8)
This commit is contained in:
		
					parent
					
						
							
								af9e7d8e9e
							
						
					
				
			
			
				commit
				
					
						302c4e30ac
					
				
			
		
					 10 changed files with 632 additions and 24 deletions
				
			
		
							
								
								
									
										32
									
								
								modules/private/forgejo_actions.go
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								modules/private/forgejo_actions.go
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,32 @@ | |||
| // SPDX-License-Identifier: MIT | ||||
| 
 | ||||
| package private | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 
 | ||||
| 	"code.gitea.io/gitea/modules/setting" | ||||
| ) | ||||
| 
 | ||||
| type ActionsRunnerRegisterRequest struct { | ||||
| 	Token   string | ||||
| 	Scope   string | ||||
| 	Labels  []string | ||||
| 	Name    string | ||||
| 	Version string | ||||
| } | ||||
| 
 | ||||
| func ActionsRunnerRegister(ctx context.Context, token, scope string, labels []string, name, version string) (string, ResponseExtra) { | ||||
| 	reqURL := setting.LocalURL + "api/internal/actions/register" | ||||
| 
 | ||||
| 	req := newInternalRequest(ctx, reqURL, "POST", ActionsRunnerRegisterRequest{ | ||||
| 		Token:   token, | ||||
| 		Scope:   scope, | ||||
| 		Labels:  labels, | ||||
| 		Name:    name, | ||||
| 		Version: version, | ||||
| 	}) | ||||
| 
 | ||||
| 	resp, extra := requestJSONResp(req, &responseText{}) | ||||
| 	return resp.Text, extra | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue