[英]Github: Download artifact from any repository's Github actions workflow
I am trying to find a place to upload a binary that has to be executed in all the workflows that we run.我正在尝试找到一个地方来上传必须在我们运行的所有工作流程中执行的二进制文件。
The problem that I am having is finding such a place.我遇到的问题是找到这样一个地方。
I tried uploading the binary as a release.我尝试将二进制文件作为发行版上传。 I am able to download this binary via the REST API but I have to pass in a personal access token to do so.我可以通过 REST API 下载这个二进制文件,但我必须传入个人访问令牌才能这样做。
Is there a way to download a release artifact without passing in a personal access token on an internal repository that is visible to all the users in the organization?有没有一种方法可以下载发布工件,而无需在组织中所有用户都可以看到的内部存储库上传递个人访问令牌?
-----------
| |
| bin.exe |
| |
-----------
/ | \
/ | \
----------- ------------ ------------
| | | | | |
| Repo 1 | | Repo 2 | | Repo 3 |
| | | | | |
----------- ------------ ------------
We have hundreds of repos and we want to pull the release artifact that is hosted in a different repo without passing in a personal access token because adding a personal access token is not feasible on hundreds of repos.我们有数百个存储库,我们希望在不传递个人访问令牌的情况下提取托管在不同存储库中的发布工件,因为在数百个存储库上添加个人访问令牌是不可行的。 We also do not want to host the binary publicly.我们也不想公开托管二进制文件。
If you have been in a similar situation, please let me know on how you resolved it.如果您遇到过类似情况,请告诉我您是如何解决的。
because adding a personal access token is not feasible on hundreds of repos因为在数百个 repos 上添加个人访问令牌是不可行的
That means using one key (a deploy key , associated to the unique repository with the binary, instead of a PAT associated to a user) in order to access said binary.这意味着使用一个密钥( 部署密钥,与二进制文件的唯一存储库关联,而不是与用户关联的 PAT)来访问所述二进制文件。
Using gh secret set
, you can add that key to hundred of repository through a script.使用gh secret set
,您可以通过脚本将该密钥添加到数百个存储库中。
Then a common GitHub action can reference that secret when executed in each repository.然后,一个常见的 GitHub 操作可以在每个存储库中执行时引用该密钥。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.