Tag: github

发送一个http请求到一个graphql api时“parsingJSON的问题”

我试图发送一个HTTP请求到Githubs graphql API(V4)。 我的猜测是我的查询格式是错误的。 下面的代码用于向api发送POST请求。 app.get('/fetch-data', function(req, res, next) { const access_token = settings.dev.TOKEN; const query = {query: { viewer: { 'login': 'muckbuck' } }}; const options = { uri: 'https://api.github.com/graphql', method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': "Bearer " + access_token, 'User-Agent': 'request', 'contentType': "application/graphql", }, data: query }; function callback(error, response, body) { […]

使用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拖到数字海洋液滴

我试图弄清楚如何从Github的数据仓库中获取一个文件到数字海洋液滴。 回购是克隆的,但在从我的本地机器上对Github提交新的更改之后,我不知道如何从Github获取文件到我的液滴。 我有一个SSH连接。 当我运行git pull时,会抛出一个错误。 error: Your local changes to the following files would be overwritten by merge: app.js Please, commit your changes or stash them before you can merge. 我尝试了各种解决scheme,我在网上find,但没有任何工作。 我将不胜感激任何帮助或链接来帮助。

从模板创build多个GitHub私有存储库

我必须以编程方式在GitHub上创build存储库。 他们每个人都会有相同的初始提交。 这是为数百人。 我find了一个命令行工具来创build工作正常的存储库,但是我需要克隆它们,移动我的模板,提交和推送。 我想知道是否已经有一个这种情况下的图书馆,或者如果我需要自己创build一个。 谢谢

我怎样才能将我的meteor应用程序部署到数字海洋?

我正在Meteor平台上构build一个应用程序,我的应用程序库保存在Github上。 我的服务器是Digital Ocean。 我试图部署在Github提交到我的远程服务器(网站)没有成功。 我尝试了三种方法,概述如下: 1.我尝试在SSH中执行“git pull”,但在收到“* branch HEAD – > FETCH_HEAD已经最新”的消息后,网站保持不变。 2.我尝试运行“mupx”,许多人推荐使用Meteor,但我收到错误消息“validation部署:失败”。 x Verifying deployment: FAILED ———————————–STDERR———————————– npm@2, which has some small npm WARN deprecated backwards-incompatible changes made to `npm run-script` and npm WARN deprecated semver behavior. npm ERR! install Couldn't read dependencies npm ERR! Failed to parse json npm ERR! Unexpected end of […]

npm安装从github库不安装devDependencies

我试图直接从GitHub( https://github.com/ethereum/web3.js )安装ethereum / web3.js存储库,但devDependencies没有被安装(只有依赖关系)。 我已经尝试了以下内容: npm install https://github.com/ethereum/web3.js.git npm install git+https://github.com/ethereum/web3.js.git npm install ethereum/web3.js npm install https://github.com/ethereum/web3.js.git –only=dev npm install git+https://github.com/ethereum/web3.js.git –only=dev npm install ethereum/web3.js –only=dev 上面的前3个命令只会在web3.js的package.json文件的dependencies部分安装5个依赖项,3“–only = dev”命令不会安装任何东西。 "dependencies": { "bignumber.js": "git+https://github.com/frozeman/bignumber.js- nolookahead.git", "crypto-js": "^3.1.4", "utf8": "^2.1.1", "xhr2": "*", "xmlhttprequest": "*" }, 当我使用以下命令时,将安装288个软件包: npm install web3 如何使用GitHub存储库链接执行相同的安装?

从GitHub获取npm模块带来“.git”文件夹

我最近分发了一个npm包,并根据我的需要进行了更新。 然后,我改变了对packages.json的依赖,指向我的GitHub仓库,它工作正常。 但是,当npm安装模块时,它也带来了git文件夹( .git )。 因此,当我尝试安装其他任何东西时,npm给我这个错误: npm ERR! path /node_modules/react-native-static-server npm ERR! code EISGIT npm ERR! git /node_modules/react-native-static-server: Appears to be a git repo or submodule. npm ERR! git /node_modules/react-native-static-server npm ERR! git Refusing to remove it. Update manually, npm ERR! git or move it out of the way first. 我究竟做错了什么? 如何避免下载.git文件夹? 你可以在这里查看回购: https : […]

validation一个github用户是一个私人组织的成员

这可能吗? 我试图看看该组织的成员名单,但它只是显示公众成员。 我有用户oauth'd他们的令牌和元数据,但他们目前的组织似乎并没有包括在内。 我可以增加范围以允许这类信息通过吗? 使用github API或node.js github库的一个例子将是太棒了。 任何一个工作!

github ssh公共密钥没有find与node.js child_process.spawn()在Windows上,但在child_process.exec()可见

此代码适用于Windows和Mac OS X: var exec = require( 'child_process' ).exec exec( 'git clone git@github.com:user/myrepo.git' ) 但是这个代码在Windows上运行时会返回一个来自git的“Access denied(publickey)”错误,但是在Mac OS X上却不会: var spawn = require( 'child_process' ).spawn , child = spawn( 'git', [ 'clone', 'git@github.com:user/myrepo.git' ], { env: process.env } ) child.on.stderr( 'data', function( data ) { console.log( data.toString() ) }) 我假设在spawn我失去了我的连接~/.ssh …但我认为发送process.env将工作。 顺便说一句, git clone命令可以直接在命令提示符下input时在Windows上正常工作。 任何明显的错误?