git - 如何使用 github api 列出目录下的所有文件名?
问题描述
我需要列出我的存储库目录下的所有文件名。
以下 api 可以列出根目录中的文件名和目录。
https://api.github.com/repos/username/repo-name/git/trees/master?recursive=1
找不到合适的 api 来明智地列出目录!
解决方案
利用https://api.github.com/repos/{owner}/{repo}/contents/{path}
请参阅此处的文档:https ://docs.github.com/en/rest/reference/repos#get-repository-content
推荐阅读
- c - 递增指针是否发生在C中的连续内存上
- debugging - 我在 ubuntu 20.04 上使用 Geany 1.36,但我没有找到调试器插件,我该如何调试?
- python - 访问用户位置(只有城市名称)(不是地图)
- python - Python:在导入时从另一个文件接收空列表
- xamarin - 在 Xamarin Android 中归档时出错
- javascript - 如何在 laravel/Alpinejs 应用程序中定义 App Component 中的常用功能?
- gradle - TeamCity - Gradle 本地存储库/离线缓存
- wagtail - 如何在 wagtails 模型管理中添加额外的自定义视图?
- ubuntu - 如何更改 nginx 文档根目录以指向 ubuntu 20.10 中不同分区中的文件夹?
- android - 打开应用程序时如何创建浮动通知?