如何使用GitHub API v3和curl创建和发布版本? [英] How to create and publish a Release using GitHub API v3 with curl?
问题描述
根据github API文档( https://developer.github.com/v3/ repos / releases / )我需要发送包含需要tag_name的有效内容的发布请求。所以我开始构建下面的curl请求,以便尝试发布一个现有的标签(0.0.5)
curl -v -i -X POST -HContent-Type:application / json-HAuthorization:token 1a1a1a11a11a11a11a11a11a11a1a11a1a1a1a1https://api.github.com/repos/codeStyler87/test-tags/releases -d'{tag_name :0.0.5,target_commitish:develop,name:0.0.5,body:发布说明,草稿:false,prerelease:false}'
但是我得到HTTP / 1.1 404 Not Found。
为什么使用GitHub API dont提供准确的错误信息?
您的访问令牌错过了特权 public_repo
。
According to the github api documentation (https://developer.github.com/v3/repos/releases/) I need to send a post request including a payload that requires the tag_name. So I proceeded to build the following curl request in order to try and publish an existing tag (0.0.5)
curl -v -i -X POST -H "Content-Type:application/json" -H "Authorization: token 1a1a1a11a11a11a11a11a11a11a1a11a1a1a1a1" https://api.github.com/repos/codeStyler87/test-tags/releases -d '{"tag_name":"0.0.5","target_commitish": "develop","name": "0.0.5","body": "Description of the release","draft": false,"prerelease": false}'
but i get HTTP/1.1 404 Not Found.
What's wrong with my request?
Am I using the API correctly?
Why GitHub API dont provide an accurate error message?
Your access token misses the privilege public_repo
.
这篇关于如何使用GitHub API v3和curl创建和发布版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!