Tag: github api

使用GitHub API编辑和添加提交消息到文件

我正在使用npm GitHub API 。 我有四块数据。 参考我想要更新的文件 我要更新的文件的path 我想要在这个文件中的新内容 我想要编辑的提交消息 另外,我可以对API进行身份validation,并有权访问此回购。 我现在如何编辑这个文件并推送这个提交? const GitHub = require('github-api') const gh = new GitHub({ token: config.app.git_token, }, githubUrl) const repo = gh.getRepo(config.app.repoOwner, config.app.repoName) repo.getRef(`heads/${config.app.repoBranch}`).then((response) => { const ref = response.data.object.sha const path = 'README.md' const content = '#Foo Bar\nthis is foo bar' const message = 'make readme foo bar' […]

在Github Api中closurescertificatevalidation

我正在使用这个github api 。 var github = new GitHubApi({ // optional debug: true, protocol: "http", host: "github.my-GHE-enabled-company.com", // should be api.github.com for GitHub pathPrefix: "/api/v3", // for some GHEs; none for GitHub headers: { "user-agent": "My-Cool-GitHub-App" // GitHub is happy with a unique user agent }, Promise: require('bluebird'), followRedirects: false, // default: true; there's currently an […]

通过github API复制版本库

我需要通过GitHub API创build包含核心文件和单个设置文件的存储库。 单个设置文件生成到每个应用程序(单个唯一文件),核心文件是静态文件,我需要上传到每个存储库。 有没有办法将核心文件放入一个仓库,只是复制该仓库,而不是每次都上传这些文件? 我用octonode模块使用node.js。 谢谢。

Github OAuth使用Express和Ember.jsstream动

我对Express.js和Github OAuth api非常陌生,并且跑到了墙上。 我要做的stream程是,用户点击Ember.js应用程序中指向Express服务器上的路线的链接。 redirect到Github oauth路由。 router.route('/oauth') .get(function(req, res){ res.redirect('https://github.com/login/oauth/authorize?client_id=XXXX&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fcallback&state=1234') }) 应用程序通过身份validation后,用户将被redirect回到路由callback router.route('/callback') .get(function(req, res){ var code = req.query.code res.redirect('https://github.com/login/oauth/access_token?client_id=XXXX&client_secret=YYYY&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fgood&code=' + code) }) 这回来了一个代码。 从这一点,我使用该代码来获取访问令牌。 访问令牌回来,但它作为一个文件下载到我的机器,而不是我的服务器的响应回来。 我错过了什么?

是否有可能在github API上进行批量请求?

我希望能够获得一系列存储库的用户数组。 据我所知,实现这一目标的唯一方法是循环访问存储库并为每个存储库提出请求。 不幸的是,这消耗了我的api-hit-count,这个数目是5000 /小时。 有没有一种方法,我可以传递一个存储库的数组,并得到一个JSON的二维数组? 注意:我正在使用node.js来写这个 现在的情况 for( var iRepo=0; iRepo<repos.length; ++iRepo ) request(repo.stargazers_url, parseUserCallback ) 我想要做 request( batchEndpoint, {repos:repos}, parseRepoUserMapCallback ) 这似乎是可以用一个简单的谷歌search解决的东西,但search任何与“GitHub”在它只是提出了各种存储库。

如何使用Angular前端和Node后端以及从OAuth开始的Git中心API创buildWeb应用程序?

我的意思是说如何stream量应该在我的客户端和服务器和GitHub服务器之间。 从OAuth开始,只有我没有得到它,也被困在获取请求的错误。 从哪里可以获取OAuth的获取请求,客户端或服务器。 什么是更好的做法?

我如何将护照js凭证转发给GitHub?

我正在使用passport.js与GitHub策略来validation用户。 我已经成功实现了用户login,并且可以查询服务器上当前用户的凭证( req.user )。 现在我想能够从我的应用程序中使用GitHub api。 由于CORS,我的设置是这样的: User Action <-> GET / POST <-> My Web Server <-> GET / POST <-> GitHub 问题是我的Web服务器需要在代表他们向GitHub发送请求时传递用户凭据。 我如何“前进”我的用户会话到GitHub? 我在我的服务器上使用superagent来调用GitHub API。

使用Node GitHub API在本地克隆远程回购

我正在使用Node GitHub API连接到GitHub上的回购站。 我可以成功获取我的远程仓库的参考资料: const dotenv = require('dotenv') const GitHub = require('github-api') dotenv.config() const api = process.env.GITHUB_URL const token = process.env.GITHUB_TOKEN const gh = new GitHub({ token }, api) const owner = process.env.GITHUB_REPO_OWNER const name = process.env.GITHUB_REPO_NAME const repo = gh.getRepo(owner, name) const branch = 'master' const ref = `heads/${branch}` repo.getRef(ref).then((response) => { // This […]

如何从Github API获取私人组织存储库列表?

我想从Github API V 3.0中检索私人组织信息库,在组织帐户中有一个私有信息库,当我想要获取我的信息库时,API只是返回我的公共和公共叉存储库,但私有存储库不会检索,任何想法?

Nodejs的GitHub的API要点创build – 接收Socket挂起来

我试图通过github api创buildGist – 使用npm模块“github”(https://github.com/ajaxorg/node-github/) 我有这个代码 var gh = new GitHubApi({ version: "3.0.0" }); gh.authenticate({ type: "oauth", token: data.token }); gh.user.get({}, function (err, data) { console.log(err); console.log(data); var blob = {}; blob.repo = commitData.repo; blob.user = commitData.user; blob.content = commitData.content; blob.encoding = commitData.encoding; gh.gitdata.createBlob(blob, function (err, blob) { console.log(err); console.log(blob); cb('failed'); }); }); 问题是createBlob函数正在接收这个 { defaultMessage: […]