【问题标题】:Use Octokit to retrieve private repositories from organizations使用 Octokit 从组织中检索私有存储库
【发布时间】:2016-05-13 10:38:32
【问题描述】:

我正在尝试使用 Octokit gem for ruby​​ 从某个用户的组织中检索所有存储库。

我有这个客户端变量:

@client = Octokit::Client.new(access_token: TOKEN)

当我使用这个时:

@client.repos

我能够检索用户的所有存储库(甚至是组织中的私人存储库)

但是有了这个

@client.repos(some_org_id)

我只从 some_org_id 组织获取公开的。

我的 OAuth 令牌范围设置了权限:

repo, user, read:org

我在这里遗漏了什么吗? API Documentaion 提到 repos 隐私的默认值为 all

提前致谢

【问题讨论】:

    标签: ruby-on-rails ruby github github-api octokit


    【解决方案1】:

    好的,我能够通过以下方式获得私人回购:

    @client.org_repos(some_repo_id)
    

    我希望它对某人有所帮助。

    【讨论】:

      【解决方案2】:

      根据this文档:

      client.org_repos('org_name', {:type => 'all'})

      一次获得所有回购,而不仅仅是一个。然后你可以用循环遍历它。

      【讨论】:

        猜你喜欢
        • 2023-04-07
        • 1970-01-01
        • 1970-01-01
        • 2018-04-11
        • 1970-01-01
        • 2021-07-11
        • 2017-02-10
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多