如何将私有工作流的输出提交到另一个公共存储库

时间:2021-06-29 13:28:29

标签: git github github-actions

我需要将我的私有仓库工作流程 (github-actions) 的输出提交到公共仓库,这可能吗?

1 个答案:

答案 0 :(得分:2)

使用标准的 git 工具应该可以做到。将这样的内容添加到您的工作流程中:

cd wherever_your_output_resides
# clone the public repo, or pull if we have a clone already
git pull origin || git clone <url> .
# check out the desired branch (optional)
git checkout some_branch
# stage output
# (you may need to tweak this, e.g. to include files not in the index yet)
git add --all
# commit
git commit -m "<message for the commit>"
# push to the remote repo
git push origin

git 命令在我的脑海里;您可能需要对这些进行试运行,直到一切顺利。