如何使用CURL上传github资产文件 [英] How to upload github asset file using CURL
本文介绍了如何使用CURL上传github资产文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将我的桌面上名为 hello.txt的文件上传到具有发布版本的git存储库中。我该怎么做呢?我阅读了git文档,但它说的像是这样:
I want to upload a file on my desktop called 'hello.txt' to my git repository which has a release. How do I do this? I read the git documentation but it says something like :
POST https://< upload_url> / repos /:owner /:repo / releases /:id / assets?name
。如何在CURL中执行此操作。我不明白。
POST https://<upload_url>/repos/:owner/:repo/releases/:id/assets?name
. How to do this in CURL. I did not understand this.
如何将此文件作为发布资源发布到我的github版本中?谢谢
How to post this file as a release asset to my github release? Thanks
推荐答案
curl \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: $(file -b --mime-type $FILE)" \
--data-binary @$FILE \
"https://uploads.github.com/repos/hubot/singularity/releases/123/assets?name=$(basename $FILE)"
- https://developer.github.com/changes/2013-09-25-releases-api/
- 无法通过API上传github发布资产
- https://developer.github.com/changes/2013-09-25-releases-api/
- Cannot upload github release asset through API
这篇关于如何使用CURL上传github资产文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文