From eeb8c22415d0b2bbcfdcfb27897633406016922b Mon Sep 17 00:00:00 2001 From: Laura Date: Sun, 31 Aug 2025 20:10:01 +0200 Subject: [PATCH] include links in github tool --- github.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/github.go b/github.go index 17626a9..eb10db2 100644 --- a/github.go +++ b/github.go @@ -193,9 +193,23 @@ func RepoOverview(ctx context.Context, arguments GitHubRepositoryArguments) (str for _, content := range contents { switch content.Type { case "dir": - directories = append(directories, content.Name) + directories = append(directories, fmt.Sprintf( + "[%s](https://github.com/%s/%s/tree/%s/%s)", + content.Name, + arguments.Owner, + arguments.Repo, + repository.DefaultBranch, + content.Name, + )) case "file": - files = append(files, content.Name) + files = append(files, fmt.Sprintf( + "[%s](https://raw.githubusercontent.com/%s/%s/refs/heads/%s/%s)", + content.Name, + arguments.Owner, + arguments.Repo, + repository.DefaultBranch, + content.Name, + )) } }