从其他人的存储库上的操作下载工件

问题描述 投票:0回答:3

这个问题看起来很简单。我正在尝试从某人的 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" }

但是这个文档意味着我需要构建一个应用程序才能下载文件???

这可能是正确的吗?

我在这里缺少什么?

github
3个回答
2
投票

这对我有用:

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>

https://github.com/actions/upload-artifact/issues/89


1
投票

您也可以直接使用基本身份验证。卷曲中:

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


0
投票

“您必须具有下载工件的操作范围。”

这意味着您的 github PAT 不具备下载此工件所需的范围。生成令牌时,您必须选择以下范围才能通过curl下载工件:

Github token select scope

注意:您只需选择

workflow
read:packages
即可。当您选择
repo
 时,会自动添加 
workflow

范围
© www.soinside.com 2019 - 2024. All rights reserved.