首页 > 解决方案 > 如何将私有工作流的输出提交到另一个公共仓库

问题描述

我需要将我的私人回购工作流(github-actions)的输出提交到公共回购是否可能?

标签: gitgithubgithub-actions

解决方案


这应该可以使用标准的 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 命令不在我的脑海中;你可能想对这些进行试运行,直到一切顺利。


推荐阅读