gitgithubgithub-actionsbuilding-github-actions

GitHub Actions, detect changes in submodule


I have two repositories A and B, both hosted on GitHub.

They have to stay separate. I want to rebuild repo A, each time repo B receives an update. It has to work using GitHub Actions only. I'd prefer if repo B would stay action-less, i.e. no CI/CD attached to that repo (I want it to store only files). I was thinking maybe I can make it work using git submodules? 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?

edit: Repo A is Static-site generator(nextjs) I'm intending to share with public. Repo B is full of text files(org-roam) which a user brings with themselves. 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). Having intertwined GitHub Actions between two repositories seems not ideal - that's why I'm searching for better solution


Solution

  • thanks to @GuiFalourd and @riQQ , I was able to put together proof-of-concept set of repositories

    Both repo share same 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: enter image description here