Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit034621b

Browse files
committed
RenameworkflowId toworkflow_file
1 parente89ccf6 commit034621b

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description
444444

445445
-`owner`: Repository owner (string, required)
446446
-`repo`: Repository name (string, required)
447-
-`workflowId`: Workflow ID or filename (string, required)
447+
-`workflow_file`: Workflow ID or filename (string, required)
448448
-`ref`: Git reference (branch or tag name) (string, required)
449449
-`inputs`: Workflow inputs (object, optional)
450450

‎pkg/github/actions.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ func RunWorkflow(getClient GetClientFn, t translations.TranslationHelperFunc) (t
2323
mcp.Required(),
2424
mcp.Description("Repository name"),
2525
),
26-
mcp.WithString("workflowId",
26+
mcp.WithString("workflow_file",
2727
mcp.Required(),
28-
mcp.Description("TheID of theworkflow. You can also passthe workflowfile name as a string."),
28+
mcp.Description("The workflow file name or ID ofthe workflowentity."),
2929
),
3030
mcp.WithString("ref",
3131
mcp.Required(),
@@ -44,7 +44,7 @@ func RunWorkflow(getClient GetClientFn, t translations.TranslationHelperFunc) (t
4444
iferr!=nil {
4545
returnmcp.NewToolResultError(err.Error()),nil
4646
}
47-
workflowID,err:=requiredParam[string](request,"workflowId")
47+
workflowFileName,err:=requiredParam[string](request,"workflow_file")
4848
iferr!=nil {
4949
returnmcp.NewToolResultError(err.Error()),nil
5050
}
@@ -76,7 +76,7 @@ func RunWorkflow(getClient GetClientFn, t translations.TranslationHelperFunc) (t
7676
returnnil,fmt.Errorf("failed to get GitHub client: %w",err)
7777
}
7878

79-
resp,err:=client.Actions.CreateWorkflowDispatchEventByFileName(ctx,owner,repo,workflowID,event)
79+
resp,err:=client.Actions.CreateWorkflowDispatchEventByFileName(ctx,owner,repo,workflowFileName,event)
8080
iferr!=nil {
8181
returnnil,fmt.Errorf("failed to trigger workflow: %w",err)
8282
}

‎pkg/github/actions_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ func Test_RunWorkflow(t *testing.T) {
2222
assert.NotEmpty(t,tool.Description)
2323
assert.Contains(t,tool.InputSchema.Properties,"owner")
2424
assert.Contains(t,tool.InputSchema.Properties,"repo")
25-
assert.Contains(t,tool.InputSchema.Properties,"workflowId")
25+
assert.Contains(t,tool.InputSchema.Properties,"workflow_file")
2626
assert.Contains(t,tool.InputSchema.Properties,"ref")
2727
assert.Contains(t,tool.InputSchema.Properties,"inputs")
28-
assert.ElementsMatch(t,tool.InputSchema.Required, []string{"owner","repo","workflowId","ref"})
28+
assert.ElementsMatch(t,tool.InputSchema.Required, []string{"owner","repo","workflow_file","ref"})
2929

3030
tests:= []struct {
3131
namestring
@@ -45,10 +45,10 @@ func Test_RunWorkflow(t *testing.T) {
4545
),
4646
),
4747
requestArgs:map[string]any{
48-
"owner":"owner",
49-
"repo":"repo",
50-
"workflowId":"workflow_id",
51-
"ref":"main",
48+
"owner":"owner",
49+
"repo":"repo",
50+
"workflow_file":"main.yaml",
51+
"ref":"main",
5252
"inputs":map[string]any{
5353
"input1":"value1",
5454
"input2":"value2",
@@ -60,9 +60,9 @@ func Test_RunWorkflow(t *testing.T) {
6060
name:"missing required parameter",
6161
mockedClient:mock.NewMockedHTTPClient(),
6262
requestArgs:map[string]any{
63-
"owner":"owner",
64-
"repo":"repo",
65-
"workflowId":"main.yaml",
63+
"owner":"owner",
64+
"repo":"repo",
65+
"workflow_file":"main.yaml",
6666
// missing ref
6767
},
6868
expectError:true,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp