Trigger github actions in sub directory

I have a GitHub repository called “foo”. “foo” has a top level .github/ci.yml to trigger GitHub Actions.

I have another repository called “bar”. “bar” has a mirror of the “foo” repository inside it like - bar/xyz/foo.

How do I create a GitHub Action in “bar”, to trigger “foo”'s GitHub Actions whenever there is a pull request to “bar” that changes code inside “foo”?

I’m afraid you can’t, workflows have to be in the top level .github/workflows/ directory. The closest thing you could do would be to copy the workflows from the foo subdirectory and adjust the paths.

However, it might be better to find a way to avoid that code duplication, e.g. using submodules.