如何在github中查看我是贡献者的存储库



我为GitHub中的多个存储库做出了贡献。现在,我正在找一个我忘了名字的。如何将它们作为列表单独查找?

我知道的唯一方法是配置文件中的Customize your pins,其中所有您的存储库分支存储库贡献存储库位于一起。

您可以通过Github公共api和一点bash和jq来实现这一点。

API是分页的,因此您需要获得github:上的提交总数

curl                                                                                                                                                                                                                             ~ Jungle
-H "Accept: application/vnd.github.cloak-preview+json" 
"https://api.github.com/search/commits?q=author:YOUR_USERNAME" 
| jq '.total_count'

您需要将total_count除以100才能知道分页的时间。

然后滚动页面:

for i in {1..NUMBER_OF_PAGES}; do curl 
-H "Accept: application/vnd.github.cloak-preview+json" 
"https://api.github.com/search/commits?q=author:YOUR_USERNAME&per_page=100&page=$i" 
| jq '.items[].repository.full_name' >> /tmp/results.txt; done;

然后sort -u /tmp/results

最新更新