[英]Get file content from private GitHub repository via JavaScript
[英]download a file from private github repository in nodejs
我需要从 nodeJS 中的私有 github 存储库下载单个文件。 有没有办法做到这一点?
我尝试使用 wget 和 curl。 它们非常适合公共存储库。 但是我找不到任何从私人存储库下载的方法。
提前致谢
鉴于您有权访问该存储库,您将需要为此创建一个 github 令牌。
curl
示例
curl --header 'Authorization: token <GH-TOKEN>' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.