github - 在工作流/Github操作之间共享工件

标签 github continuous-integration github-actions

我知道您可以在相同工作流程的作业之间共享工件。

但是,如何在不同的工作流程之间共享工件?

最佳答案

GitHub现在添加了REST API for downloading artifacts。基本上你会

GET repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}
然后,您必须在响应中查找Location:,然后访问该URL以下载工件。网址有效期为1分钟。
有一个使用上述API的GitHub Action,您可以轻松地将其添加到工作流中。我这样用
- name: Download artifact
  uses: dawidd6/action-download-artifact@v2
  with:
    workflow: ${{ github.event.workflow_run.workflow_id }}
    workflow_conclusion: success
在这里阅读更多关于它的信息:https://github.com/dawidd6/action-download-artifact

关于github - 在工作流/Github操作之间共享工件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60355925/

相关文章:

firebase - CircleCI 工作流程找不到 Firebase 项目 : Invalid project selection please verify project 'project' exists and you have access

node.js - Github Action err : bash: line 3: npm: command not found

Python - 解决 PEP8 错误

GitHub Mylyn 连接器 : Getting issues from GitHub

github - 当 Windows 与 ssh 密码一起启动时启动 ssh-agent

testing - 应用程序的自动化操作系统测试?

git - 如何将 git repo 添加为自身的子模块? (或 : How to generate GitHub Pages programmatically? )

git - 将忽略的 dist 文件夹部署到 GitHub Pages

continuous-integration - 持续集成的代码设计

docker - 如何在 Github Action 上登录 pull registry for services