如何使用curl创建Github Pull Request? [英] How to create Github Pull Request using curl?

查看:136
本文介绍了如何使用curl创建Github Pull Request?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用curl(在bash脚本中)创建一个Github Pull Request并使用令牌进行身份验证。

I am trying to create a Github Pull Request using curl (in a bash script) and authenticating using token.

我收到 curl -u我的用户:令牌https://api.github.com/user 。
我得到 curl https://api.github.com/repos/repo-owner/repo-name/pulls

但是当我尝试使用以下curl命令创建请求请求时,出现错误:

But when I try to create a pull request using the following curl command, I am getting errors:

curl -d '{"title":"testPR","base":"master", "head":"user-repo:master"}' https://api.github.com/repos/repo-owner/repo-name/pulls

{
  "message": "Not Found",
  "documentation_url": "https://developer.github.com/v3/pulls/#create-a-pull-request"
}

如何解决?我在做什么错?

How to fix? What I am doing wrong?

我对使用 hub 与集线器正常工作的创建请求不感兴趣。我想知道如何使用curl并做到这一点。

I am not interested in creating pull request using hub its working fine with hub. I want to know how to use curl and do that. Thank you in advance!

推荐答案

如果仍在为此苦苦挣扎,请确保您使用的令牌具有 public_repos权限。

If you're still struggling with this, make sure the token you're using has the "public_repos" permission.

这篇关于如何使用curl创建Github Pull Request?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆