使用 GitHub API V3 从组织获取私有仓库

编程入门 行业动态 更新时间:2024-10-21 05:46:40
本文介绍了使用 GitHub API V3 从组织获取私有仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我在获取和组织私人存储库时遇到问题.我正在使用这种方法的 API V3:http://share.jjnford/HhIZ

I am having trouble obtaining and organizing private repos. I am using API V3 with this method: http://share.jjnford/HhIZ

我正在使用 jQuery.getJSON 命令并将我的 OAuth2 访问令牌传递给 API URL,但我只得到公共存储库的返回.

I am using the jQuery.getJSON command and passing my OAuth2 access token to the API URL but am only getting public repositories returns.

此外,如果我将私有组织存储库分叉到用户帐户(上下文)并拉取用户存储库,则除了从组织分叉的私有存储库外,所有存储库(公共和私有)都会显示出来.

Also if I fork a private organization repository to a user account (context) and pull the users repositories all the repos (public & private) show up except the private repo forked from an organization.

谁能帮我解决这个问题...这是我最后的障碍...

Can anybody help me out with this... it is my last hurdle...

提前致谢!

推荐答案

我已发现问题并已更正.根据 GitHub API V3,可以使用多个范围.似乎用户"范围不再有效.一旦我只使用了repo"范围,一切都被正确检索(私有组织存储库和私有分叉组织存储库).

I have found the problem and corrected it. According the the GitHub API V3 there are multiple scopes that can be used. It seems the the "user" scope is not valid anymore. Once I used just the "repo" scope everything was retrieved correctly (private org repos, and private forked org repos).

这篇关于使用 GitHub API V3 从组织获取私有仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-18 15:17:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/942708.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:仓库   组织   GitHub   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!