简体   繁体   English

GitHub 动作,检测子模块的变化

[英]GitHub Actions, detect changes in submodule

I have two repositories A and B, both hosted on GitHub.我有两个存储库 A 和 B,都托管在 GitHub 上。

  • Repo A is static site generator code. Repo A 是 static 站点生成器代码。
  • Repo B is bunch of text files. Repo B 是一堆文本文件。

They have to stay separate.他们必须保持分开。 I want to rebuild repo A, each time repo B receives an update.我想重建 repo A,每次 repo B 收到更新。 It has to work using GitHub Actions only.它必须仅使用 GitHub 操作才能工作。 I'd prefer if repo B would stay action-less, ie no CI/CD attached to that repo (I want it to store only files).我希望 repo B 保持无动作,即没有 CI/CD 附加到该 repo(我希望它只存储文件)。 I was thinking maybe I can make it work using git submodules?我在想也许我可以使用 git 子模块让它工作? Repo B would be a submodule within Repo A. Is it possible to build GH action within repo A, to detect changes in repo B and pull from there? Repo B 将是 Repo A 中的一个子模块。是否可以在 repo A 中构建 GH 操作,以检测 repo B 中的更改并从那里提取?

edit: Repo A is Static-site generator( nextjs ) I'm intending to share with public.编辑:回购 A 是我打算与公众分享的静态站点生成器( nextjs )。 Repo B is full of text files( org-roam ) which a user brings with themselves. Repo B 充满了用户自带的文本文件( org-roam )。 Together they build a personal wiki website.他们一起建立了一个个人维基网站。 I'd want to minimize the configuration hassle - that's why I want to have all CI/CD and code encapsulated in Repo A, so the user could just fork it, and plug-and-play it with their knowledge base repository (repo B).我想尽量减少配置麻烦 - 这就是为什么我希望将所有 CI/CD 和代码封装在 Repo A 中,这样用户就可以分叉它,并使用他们的知识库存储库(repo B )。 Having intertwined GitHub Actions between two repositories seems not ideal - that's why I'm searching for better solution在两个存储库之间交织 GitHub 操作似乎并不理想 - 这就是我正在寻找更好的解决方案的原因

thanks to @GuiFalourd and @riQQ, I was able to put together proof-of-concept set of repositories感谢@GuiFalourd 和@riQQ,我能够将概念验证集存储库放在一起

Both repo share same GitHub Personal Access Token .两个 repo 共享相同的 GitHub Personal Access Token To fill the blanks from the blog.marcnuri.com guide, here is minimal set of permissions required to make this work (given both repositories are public, otherwise you need repo permission:要填补 blog.marcnuri.com 指南中的空白,这里是完成这项工作所需的最小权限集(假设两个存储库都是公共的,否则您需要repo权限: 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM