File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -377,6 +377,37 @@ func Test_ActionsRunTrigger_RunWorkflow(t *testing.T) {
377377 expectError : true ,
378378 expectedErrMsg : "ref is required for run_workflow action" ,
379379 },
380+ {
381+ name : "successful workflow run with inputs" ,
382+ mockedClient : MockHTTPClientWithHandlers (map [string ]http.HandlerFunc {
383+ PostReposActionsWorkflowsDispatchesByOwnerByRepoByWorkflowID : http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
384+ w .WriteHeader (http .StatusNoContent )
385+ }),
386+ }),
387+ requestArgs : map [string ]any {
388+ "method" : "run_workflow" ,
389+ "owner" : "owner" ,
390+ "repo" : "repo" ,
391+ "workflow_id" : "12345" ,
392+ "ref" : "main" ,
393+ "inputs" : map [string ]any {"FIELD1" : "value1" , "FIELD2" : "value2" },
394+ },
395+ expectError : false ,
396+ },
397+ {
398+ name : "invalid inputs type returns error" ,
399+ mockedClient : MockHTTPClientWithHandlers (map [string ]http.HandlerFunc {}),
400+ requestArgs : map [string ]any {
401+ "method" : "run_workflow" ,
402+ "owner" : "owner" ,
403+ "repo" : "repo" ,
404+ "workflow_id" : "12345" ,
405+ "ref" : "main" ,
406+ "inputs" : "not a map" ,
407+ },
408+ expectError : true ,
409+ expectedErrMsg : "parameter inputs is not of type map[string]interface {}, is string" ,
410+ },
380411 }
381412
382413 for _ , tc := range tests {
You can’t perform that action at this time.
0 commit comments