在CI服务器上,我想获取我们在Github上维护的配置文件,以便它可以在许多作业之间共享。 我正在尝试通过curl获取此文件,但以下两种方法都失败了(我收到了404错误):
# As advised by the oAuth docs
curl -H 'Authorization: token the_token' -L -o setup.sh https://raw.github.com/org/repo/file
# The url of the raw file after clicking to view it
curl -L https://raw.github.com/org/repo/file?login=username&token=the_token
curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/owner/repo/contents/path
将返回原始文件。 - Alf Eatonhttps://``api.``github.com/``repos/``<owner>/<repo>/``contents/``<path/to/file>
(抱歉有些凌乱) - PJSCopelandrepo
和admin:org / read:org
(在私有存储库上)。 - rlat