Home > Blockchain >  Trigger GitHub Actions Only for a Sub Module in a Multi Module Project
Trigger GitHub Actions Only for a Sub Module in a Multi Module Project

Time:01-01

I have a multi module GitHub project which I would like to build using GitHub actions. The action script that I have written is a publish script that triggers when a tag is pushed. I need two things here that should work out, but before here is my project structure:

main-project:
 build.sbt
 module1:
   build.sbt
   src/main/scala/.... 
 module2:
   build.sbt
   src/main/scala/....

I need to have a mechanism check that does the following:

  1. When I push a tag, I will trigger my workflow and I would like that my workflow is only publishing module 1 changes

  2. Is there a way to git tag only module 1?

CodePudding user response:

If you only ever want to publish module1, you can set publish / skip := true in the project settings in build.sbt for other modules and the root project.

CodePudding user response:

If your modules are on different paths within the same Git repository, you could use a path-filter action, as illustrated here.

Note that you cannot tag just a part of a repository, but, if your changes involves only that one module, you can then decide apply a (global) tag with a naming convention reflecting the nature of the change (IE only module1 or only module2).

  • Related