'How to trigger a pipeline when a submodule changes?

I have a few repositories that use the same submodule. Is there a way to set those repositories to run a pipeline automatically when the origin of their submodule changes?

For instance if I push something on the parent repo, I want it to automatically notify the change to all the repositories using it as a submodule that the change has happened and that their pipeline needs to be run.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source