mirror of
https://github.com/coalaura/whiskr.git
synced 2025-09-08 17:06:42 +00:00
include links in github tool
This commit is contained in:
18
github.go
18
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,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user