自动化涉及第三方存储库的GitHub工作流程
我有一个github repo myrepo
,它扫描了另一个repo 其repo
的内容,并将它们转换为JSON文件。详细信息并不是那么重要,只是myrepo
使用nodejs并将保留为subpoule。许可证这不是问题。
我想实现的是,当他们的repo
合并到main
,myrepo
magally 更新并构建新文件。我想使用现有的基础架构,例如GitHub动作,NetLify构建过程等。
您将如何处理?
我不希望为 magical 部分提供详细的解决方案,而是在寻找一些指针,这让我开始了。
I have a GitHub repo myRepo
that scans the contents of another repo theirRepo
and converts them to JSON files. The details aren't really that important, just so much that myRepo
uses nodeJS and holds theirRepo
as a submodule. Licensewise this is not a problem.
What I'd like to achieve is that, when theirRepo
merges into main
, myRepo
magically updates and builds the new files. I'd like to use existing infrastructures such as GitHub actions, Netlify build processes etc.
How would you approach this?
I don't expect a detailed solution for the magical part, but am rather looking for a few pointers, something that gets me started.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于GitHub Action(AFAIK)当前不允许基于其他存储库的更改(除非您控制另一个存储库的工作流程)触发事件。
的其他repo中的文件更改
我不熟悉节点
这是一个粗略的近似值,您可能还需要确定每个合并PR可能会更改的多个文件。
基于CRON的工作
每N小时/分钟或其他时间间隔运行您的工作,以检查更改。
仅在另一个回购中的文件更改中的文件时,使用缓存
才能运行您的操作,这是这些行:
As GitHub Actions (AFAIK) does not currently allow to trigger events based on changes in other repositories (unless you control another repository’s workflows) one might have to hack a little bit.
File change in OtherRepo
I’m not familiar with Node, but, depending on the project culture following files might change during the new release/main branch update:
This is a rough approximation, you might also want to identify multiple files likely to change with each merged PR.
Cron based jobs
Run your job every N hours/minutes or another time interval to check for changes.
Use caching
Run your action only when files in another repo change, something along these lines: