这个问题看起来很简单。我正在尝试从某人的 github 存储库下载程序的预构建二进制文件。
他们建议我可以这样做: “您还可以从 GitHub Actions 工件下载预构建的二进制文件。”
但事实证明我不知道这意味着什么!
该文件不在操作页面中(我不确定是否应该在操作页面中),当我尝试时:
curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/nbdd0121/wsld/actions/artifacts/42682371/zip
我收到了
{ "message": "You must have the actions scope to download artifacts.", "documentation_url": "https://docs.github.com/rest/reference/actions#download-an-artifact" }
但是这个文档意味着我需要构建一个应用程序才能下载文件???
这可能是正确的吗?
我在这里缺少什么?
这对我有用:
curl.exe `
--netrc-file C:\Users\Steven\_netrc `
-L `
-o wsldhost.exe.zip `
https://api.github.com/repos/nbdd0121/wsld/actions/artifacts/42682371/zip
_netrc
看起来像这样:
default login <USERNAME> password <PERSONAL ACCESS TOKEN>
您也可以直接使用基本身份验证。卷曲中:
curl -L -u <USERNAME>:<PERSONAL_ACCESS_TOKEN> -o artifact.zip https://api.github.com/repos/nbdd0121/wsld/actions/artifacts/42682371/zip
个人访问令牌生成于:https://github.com/settings/tokens