【问题标题】:Automatically run the workflow on the main repo when a submodule repo changes当子模块 repo 更改时,在主 repo 上自动运行工作流
【发布时间】:2021-11-05 16:42:34
【问题描述】:

我有一个包含子模块 repo 的存储库,我想运行主 repo 的工作流,以防任何子模块 repo 发生更改。 有什么建议吗?

【问题讨论】:

  • 嗨,有趣,也许这可能是有趣的stackoverflow.com/questions/16511616/…
  • 子模块将如何变化?会是手动的吗?您可以在工作流中使用 paths 子类型 on 触发器,以便仅在更新子模块文件时运行。
  • 我的意思是,如果我对子模块 repo 进行更改,我希望主 repo 上的工作流开始运行。我尝试使用路径并给它一个我的子模块 'dir1/submoduledir' 的路径,但它不起作用。

标签: github workflow github-actions


【解决方案1】:

首先,我应该切换到 master 分支。

cd otherrepo/
git checkout master

对子模块存储库进行更改后,我应该先推送这些更改。

cd otherrepo/
** making changes – Editing README.md file **
git add README.md
git commit -m 'editing README.md'
git push origin master

然后,推送主仓库。

cd ..
git add otherrepo
git commit -m 'editing otherrepo submodule'
git push origin master

【讨论】:

    猜你喜欢
    • 2015-10-20
    • 1970-01-01
    • 1970-01-01
    • 2020-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多