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

Commit3ba73e0

Browse files
committed
refactor: standardize parameter handling and read-only hints in GitHub Actions tools
- Replaced instances of `requiredParam` with `RequiredParam` for consistency across all tools.- Updated `toBoolPtr` to `ToBoolPtr` in tool annotations to maintain uniformity in boolean pointer handling.- Ensured all tools in the GitHub Actions suite adhere to the new naming conventions for improved readability and maintainability.
1 parent6feed0e commit3ba73e0

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

‎pkg/github/actions.go

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func ListWorkflows(getClient GetClientFn, t translations.TranslationHelperFunc)
1919
returnmcp.NewTool("list_workflows",
2020
mcp.WithDescription(t("TOOL_LIST_WORKFLOWS_DESCRIPTION","List workflows in a repository")),
2121
mcp.WithToolAnnotation(mcp.ToolAnnotation{
22-
ReadOnlyHint:toBoolPtr(true),
22+
ReadOnlyHint:ToBoolPtr(true),
2323
}),
2424
mcp.WithString("owner",
2525
mcp.Required(),
@@ -37,11 +37,11 @@ func ListWorkflows(getClient GetClientFn, t translations.TranslationHelperFunc)
3737
),
3838
),
3939
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
40-
owner,err:=requiredParam[string](request,"owner")
40+
owner,err:=RequiredParam[string](request,"owner")
4141
iferr!=nil {
4242
returnmcp.NewToolResultError(err.Error()),nil
4343
}
44-
repo,err:=requiredParam[string](request,"repo")
44+
repo,err:=RequiredParam[string](request,"repo")
4545
iferr!=nil {
4646
returnmcp.NewToolResultError(err.Error()),nil
4747
}
@@ -87,7 +87,7 @@ func ListWorkflowRuns(getClient GetClientFn, t translations.TranslationHelperFun
8787
returnmcp.NewTool("list_workflow_runs",
8888
mcp.WithDescription(t("TOOL_LIST_WORKFLOW_RUNS_DESCRIPTION","List workflow runs for a specific workflow")),
8989
mcp.WithToolAnnotation(mcp.ToolAnnotation{
90-
ReadOnlyHint:toBoolPtr(true),
90+
ReadOnlyHint:ToBoolPtr(true),
9191
}),
9292
mcp.WithString("owner",
9393
mcp.Required(),
@@ -121,15 +121,15 @@ func ListWorkflowRuns(getClient GetClientFn, t translations.TranslationHelperFun
121121
),
122122
),
123123
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
124-
owner,err:=requiredParam[string](request,"owner")
124+
owner,err:=RequiredParam[string](request,"owner")
125125
iferr!=nil {
126126
returnmcp.NewToolResultError(err.Error()),nil
127127
}
128-
repo,err:=requiredParam[string](request,"repo")
128+
repo,err:=RequiredParam[string](request,"repo")
129129
iferr!=nil {
130130
returnmcp.NewToolResultError(err.Error()),nil
131131
}
132-
workflowID,err:=requiredParam[string](request,"workflow_id")
132+
workflowID,err:=RequiredParam[string](request,"workflow_id")
133133
iferr!=nil {
134134
returnmcp.NewToolResultError(err.Error()),nil
135135
}
@@ -199,7 +199,7 @@ func RunWorkflow(getClient GetClientFn, t translations.TranslationHelperFunc) (t
199199
returnmcp.NewTool("run_workflow",
200200
mcp.WithDescription(t("TOOL_RUN_WORKFLOW_DESCRIPTION","Run an Actions workflow")),
201201
mcp.WithToolAnnotation(mcp.ToolAnnotation{
202-
ReadOnlyHint:toBoolPtr(false),
202+
ReadOnlyHint:ToBoolPtr(false),
203203
}),
204204
mcp.WithString("owner",
205205
mcp.Required(),
@@ -222,19 +222,19 @@ func RunWorkflow(getClient GetClientFn, t translations.TranslationHelperFunc) (t
222222
),
223223
),
224224
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
225-
owner,err:=requiredParam[string](request,"owner")
225+
owner,err:=RequiredParam[string](request,"owner")
226226
iferr!=nil {
227227
returnmcp.NewToolResultError(err.Error()),nil
228228
}
229-
repo,err:=requiredParam[string](request,"repo")
229+
repo,err:=RequiredParam[string](request,"repo")
230230
iferr!=nil {
231231
returnmcp.NewToolResultError(err.Error()),nil
232232
}
233-
workflowFile,err:=requiredParam[string](request,"workflow_file")
233+
workflowFile,err:=RequiredParam[string](request,"workflow_file")
234234
iferr!=nil {
235235
returnmcp.NewToolResultError(err.Error()),nil
236236
}
237-
ref,err:=requiredParam[string](request,"ref")
237+
ref,err:=RequiredParam[string](request,"ref")
238238
iferr!=nil {
239239
returnmcp.NewToolResultError(err.Error()),nil
240240
}
@@ -286,7 +286,7 @@ func GetWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFunc)
286286
returnmcp.NewTool("get_workflow_run",
287287
mcp.WithDescription(t("TOOL_GET_WORKFLOW_RUN_DESCRIPTION","Get details of a specific workflow run")),
288288
mcp.WithToolAnnotation(mcp.ToolAnnotation{
289-
ReadOnlyHint:toBoolPtr(true),
289+
ReadOnlyHint:ToBoolPtr(true),
290290
}),
291291
mcp.WithString("owner",
292292
mcp.Required(),
@@ -302,11 +302,11 @@ func GetWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFunc)
302302
),
303303
),
304304
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
305-
owner,err:=requiredParam[string](request,"owner")
305+
owner,err:=RequiredParam[string](request,"owner")
306306
iferr!=nil {
307307
returnmcp.NewToolResultError(err.Error()),nil
308308
}
309-
repo,err:=requiredParam[string](request,"repo")
309+
repo,err:=RequiredParam[string](request,"repo")
310310
iferr!=nil {
311311
returnmcp.NewToolResultError(err.Error()),nil
312312
}
@@ -341,7 +341,7 @@ func GetWorkflowRunLogs(getClient GetClientFn, t translations.TranslationHelperF
341341
returnmcp.NewTool("get_workflow_run_logs",
342342
mcp.WithDescription(t("TOOL_GET_WORKFLOW_RUN_LOGS_DESCRIPTION","Download logs for a specific workflow run (EXPENSIVE: downloads ALL logs as ZIP. Consider using get_job_logs with failed_only=true for debugging failed jobs)")),
343343
mcp.WithToolAnnotation(mcp.ToolAnnotation{
344-
ReadOnlyHint:toBoolPtr(true),
344+
ReadOnlyHint:ToBoolPtr(true),
345345
}),
346346
mcp.WithString("owner",
347347
mcp.Required(),
@@ -357,11 +357,11 @@ func GetWorkflowRunLogs(getClient GetClientFn, t translations.TranslationHelperF
357357
),
358358
),
359359
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
360-
owner,err:=requiredParam[string](request,"owner")
360+
owner,err:=RequiredParam[string](request,"owner")
361361
iferr!=nil {
362362
returnmcp.NewToolResultError(err.Error()),nil
363363
}
364-
repo,err:=requiredParam[string](request,"repo")
364+
repo,err:=RequiredParam[string](request,"repo")
365365
iferr!=nil {
366366
returnmcp.NewToolResultError(err.Error()),nil
367367
}
@@ -406,7 +406,7 @@ func ListWorkflowJobs(getClient GetClientFn, t translations.TranslationHelperFun
406406
returnmcp.NewTool("list_workflow_jobs",
407407
mcp.WithDescription(t("TOOL_LIST_WORKFLOW_JOBS_DESCRIPTION","List jobs for a specific workflow run")),
408408
mcp.WithToolAnnotation(mcp.ToolAnnotation{
409-
ReadOnlyHint:toBoolPtr(true),
409+
ReadOnlyHint:ToBoolPtr(true),
410410
}),
411411
mcp.WithString("owner",
412412
mcp.Required(),
@@ -431,11 +431,11 @@ func ListWorkflowJobs(getClient GetClientFn, t translations.TranslationHelperFun
431431
),
432432
),
433433
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
434-
owner,err:=requiredParam[string](request,"owner")
434+
owner,err:=RequiredParam[string](request,"owner")
435435
iferr!=nil {
436436
returnmcp.NewToolResultError(err.Error()),nil
437437
}
438-
repo,err:=requiredParam[string](request,"repo")
438+
repo,err:=RequiredParam[string](request,"repo")
439439
iferr!=nil {
440440
returnmcp.NewToolResultError(err.Error()),nil
441441
}
@@ -501,7 +501,7 @@ func GetJobLogs(getClient GetClientFn, t translations.TranslationHelperFunc) (to
501501
returnmcp.NewTool("get_job_logs",
502502
mcp.WithDescription(t("TOOL_GET_JOB_LOGS_DESCRIPTION","Download logs for a specific workflow job or efficiently get all failed job logs for a workflow run")),
503503
mcp.WithToolAnnotation(mcp.ToolAnnotation{
504-
ReadOnlyHint:toBoolPtr(true),
504+
ReadOnlyHint:ToBoolPtr(true),
505505
}),
506506
mcp.WithString("owner",
507507
mcp.Required(),
@@ -525,11 +525,11 @@ func GetJobLogs(getClient GetClientFn, t translations.TranslationHelperFunc) (to
525525
),
526526
),
527527
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
528-
owner,err:=requiredParam[string](request,"owner")
528+
owner,err:=RequiredParam[string](request,"owner")
529529
iferr!=nil {
530530
returnmcp.NewToolResultError(err.Error()),nil
531531
}
532-
repo,err:=requiredParam[string](request,"repo")
532+
repo,err:=RequiredParam[string](request,"repo")
533533
iferr!=nil {
534534
returnmcp.NewToolResultError(err.Error()),nil
535535
}
@@ -715,7 +715,7 @@ func RerunWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFun
715715
returnmcp.NewTool("rerun_workflow_run",
716716
mcp.WithDescription(t("TOOL_RERUN_WORKFLOW_RUN_DESCRIPTION","Re-run an entire workflow run")),
717717
mcp.WithToolAnnotation(mcp.ToolAnnotation{
718-
ReadOnlyHint:toBoolPtr(false),
718+
ReadOnlyHint:ToBoolPtr(false),
719719
}),
720720
mcp.WithString("owner",
721721
mcp.Required(),
@@ -731,11 +731,11 @@ func RerunWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFun
731731
),
732732
),
733733
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
734-
owner,err:=requiredParam[string](request,"owner")
734+
owner,err:=RequiredParam[string](request,"owner")
735735
iferr!=nil {
736736
returnmcp.NewToolResultError(err.Error()),nil
737737
}
738-
repo,err:=requiredParam[string](request,"repo")
738+
repo,err:=RequiredParam[string](request,"repo")
739739
iferr!=nil {
740740
returnmcp.NewToolResultError(err.Error()),nil
741741
}
@@ -777,7 +777,7 @@ func RerunFailedJobs(getClient GetClientFn, t translations.TranslationHelperFunc
777777
returnmcp.NewTool("rerun_failed_jobs",
778778
mcp.WithDescription(t("TOOL_RERUN_FAILED_JOBS_DESCRIPTION","Re-run only the failed jobs in a workflow run")),
779779
mcp.WithToolAnnotation(mcp.ToolAnnotation{
780-
ReadOnlyHint:toBoolPtr(false),
780+
ReadOnlyHint:ToBoolPtr(false),
781781
}),
782782
mcp.WithString("owner",
783783
mcp.Required(),
@@ -793,11 +793,11 @@ func RerunFailedJobs(getClient GetClientFn, t translations.TranslationHelperFunc
793793
),
794794
),
795795
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
796-
owner,err:=requiredParam[string](request,"owner")
796+
owner,err:=RequiredParam[string](request,"owner")
797797
iferr!=nil {
798798
returnmcp.NewToolResultError(err.Error()),nil
799799
}
800-
repo,err:=requiredParam[string](request,"repo")
800+
repo,err:=RequiredParam[string](request,"repo")
801801
iferr!=nil {
802802
returnmcp.NewToolResultError(err.Error()),nil
803803
}
@@ -839,7 +839,7 @@ func CancelWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFu
839839
returnmcp.NewTool("cancel_workflow_run",
840840
mcp.WithDescription(t("TOOL_CANCEL_WORKFLOW_RUN_DESCRIPTION","Cancel a workflow run")),
841841
mcp.WithToolAnnotation(mcp.ToolAnnotation{
842-
ReadOnlyHint:toBoolPtr(false),
842+
ReadOnlyHint:ToBoolPtr(false),
843843
}),
844844
mcp.WithString("owner",
845845
mcp.Required(),
@@ -855,11 +855,11 @@ func CancelWorkflowRun(getClient GetClientFn, t translations.TranslationHelperFu
855855
),
856856
),
857857
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
858-
owner,err:=requiredParam[string](request,"owner")
858+
owner,err:=RequiredParam[string](request,"owner")
859859
iferr!=nil {
860860
returnmcp.NewToolResultError(err.Error()),nil
861861
}
862-
repo,err:=requiredParam[string](request,"repo")
862+
repo,err:=RequiredParam[string](request,"repo")
863863
iferr!=nil {
864864
returnmcp.NewToolResultError(err.Error()),nil
865865
}
@@ -901,7 +901,7 @@ func ListWorkflowRunArtifacts(getClient GetClientFn, t translations.TranslationH
901901
returnmcp.NewTool("list_workflow_run_artifacts",
902902
mcp.WithDescription(t("TOOL_LIST_WORKFLOW_RUN_ARTIFACTS_DESCRIPTION","List artifacts for a workflow run")),
903903
mcp.WithToolAnnotation(mcp.ToolAnnotation{
904-
ReadOnlyHint:toBoolPtr(true),
904+
ReadOnlyHint:ToBoolPtr(true),
905905
}),
906906
mcp.WithString("owner",
907907
mcp.Required(),
@@ -923,11 +923,11 @@ func ListWorkflowRunArtifacts(getClient GetClientFn, t translations.TranslationH
923923
),
924924
),
925925
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
926-
owner,err:=requiredParam[string](request,"owner")
926+
owner,err:=RequiredParam[string](request,"owner")
927927
iferr!=nil {
928928
returnmcp.NewToolResultError(err.Error()),nil
929929
}
930-
repo,err:=requiredParam[string](request,"repo")
930+
repo,err:=RequiredParam[string](request,"repo")
931931
iferr!=nil {
932932
returnmcp.NewToolResultError(err.Error()),nil
933933
}
@@ -978,7 +978,7 @@ func DownloadWorkflowRunArtifact(getClient GetClientFn, t translations.Translati
978978
returnmcp.NewTool("download_workflow_run_artifact",
979979
mcp.WithDescription(t("TOOL_DOWNLOAD_WORKFLOW_RUN_ARTIFACT_DESCRIPTION","Get download URL for a workflow run artifact")),
980980
mcp.WithToolAnnotation(mcp.ToolAnnotation{
981-
ReadOnlyHint:toBoolPtr(true),
981+
ReadOnlyHint:ToBoolPtr(true),
982982
}),
983983
mcp.WithString("owner",
984984
mcp.Required(),
@@ -994,11 +994,11 @@ func DownloadWorkflowRunArtifact(getClient GetClientFn, t translations.Translati
994994
),
995995
),
996996
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
997-
owner,err:=requiredParam[string](request,"owner")
997+
owner,err:=RequiredParam[string](request,"owner")
998998
iferr!=nil {
999999
returnmcp.NewToolResultError(err.Error()),nil
10001000
}
1001-
repo,err:=requiredParam[string](request,"repo")
1001+
repo,err:=RequiredParam[string](request,"repo")
10021002
iferr!=nil {
10031003
returnmcp.NewToolResultError(err.Error()),nil
10041004
}
@@ -1042,8 +1042,8 @@ func DeleteWorkflowRunLogs(getClient GetClientFn, t translations.TranslationHelp
10421042
returnmcp.NewTool("delete_workflow_run_logs",
10431043
mcp.WithDescription(t("TOOL_DELETE_WORKFLOW_RUN_LOGS_DESCRIPTION","Delete logs for a workflow run")),
10441044
mcp.WithToolAnnotation(mcp.ToolAnnotation{
1045-
ReadOnlyHint:toBoolPtr(false),
1046-
DestructiveHint:toBoolPtr(true),
1045+
ReadOnlyHint:ToBoolPtr(false),
1046+
DestructiveHint:ToBoolPtr(true),
10471047
}),
10481048
mcp.WithString("owner",
10491049
mcp.Required(),
@@ -1059,11 +1059,11 @@ func DeleteWorkflowRunLogs(getClient GetClientFn, t translations.TranslationHelp
10591059
),
10601060
),
10611061
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
1062-
owner,err:=requiredParam[string](request,"owner")
1062+
owner,err:=RequiredParam[string](request,"owner")
10631063
iferr!=nil {
10641064
returnmcp.NewToolResultError(err.Error()),nil
10651065
}
1066-
repo,err:=requiredParam[string](request,"repo")
1066+
repo,err:=RequiredParam[string](request,"repo")
10671067
iferr!=nil {
10681068
returnmcp.NewToolResultError(err.Error()),nil
10691069
}
@@ -1105,7 +1105,7 @@ func GetWorkflowRunUsage(getClient GetClientFn, t translations.TranslationHelper
11051105
returnmcp.NewTool("get_workflow_run_usage",
11061106
mcp.WithDescription(t("TOOL_GET_WORKFLOW_RUN_USAGE_DESCRIPTION","Get usage metrics for a workflow run")),
11071107
mcp.WithToolAnnotation(mcp.ToolAnnotation{
1108-
ReadOnlyHint:toBoolPtr(true),
1108+
ReadOnlyHint:ToBoolPtr(true),
11091109
}),
11101110
mcp.WithString("owner",
11111111
mcp.Required(),
@@ -1121,11 +1121,11 @@ func GetWorkflowRunUsage(getClient GetClientFn, t translations.TranslationHelper
11211121
),
11221122
),
11231123
func(ctx context.Context,request mcp.CallToolRequest) (*mcp.CallToolResult,error) {
1124-
owner,err:=requiredParam[string](request,"owner")
1124+
owner,err:=RequiredParam[string](request,"owner")
11251125
iferr!=nil {
11261126
returnmcp.NewToolResultError(err.Error()),nil
11271127
}
1128-
repo,err:=requiredParam[string](request,"repo")
1128+
repo,err:=RequiredParam[string](request,"repo")
11291129
iferr!=nil {
11301130
returnmcp.NewToolResultError(err.Error()),nil
11311131
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp