Github API List all repositories and repo's content

后端 未结 8 760
陌清茗
陌清茗 2020-12-23 21:03

If I was to go about displaying just MY github repositories and their contents on an external website how would i go about doing this? Are there any source code\'s you can

8条回答
  •  攒了一身酷
    2020-12-23 21:36

    you can use github api

    organization="write-here-the-organization"
    githubuser="your-github-user"
    token=`curl -i -u ${githubuser}  -d '{"scopes": ["repo"]}' https://api.github.com/authorizations | grep token | cut -d\" -f 4`
    curl -i -H "Authorization: token ${token}" https://api.github.com/orgs/${organization}/repos 
    

    as result of the above you will get a long json with all repositories, and their information. you can continue from here.

提交回复
热议问题