Skip to content

Commit 26e1b7a

Browse files
committed
Fix: path param should be optional
1 parent ce2e4f9 commit 26e1b7a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/github/repositories.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,13 @@ func GetFileContents(t translations.TranslationHelperFunc) inventory.ServerTool
670670
if err != nil {
671671
return utils.NewToolResultError(err.Error()), nil, nil
672672
}
673-
path, err := RequiredParam[string](args, "path")
673+
674+
path, err := OptionalParam[string](args, "path")
674675
if err != nil {
675676
return utils.NewToolResultError(err.Error()), nil, nil
676677
}
678+
path = strings.TrimPrefix(path, "/")
679+
677680
ref, err := OptionalParam[string](args, "ref")
678681
if err != nil {
679682
return utils.NewToolResultError(err.Error()), nil, nil

0 commit comments

Comments
 (0)