diff --git a/workflow-direct/main.go b/workflow-direct/main.go index 4addf71..81f1d38 100644 --- a/workflow-direct/main.go +++ b/workflow-direct/main.go @@ -187,7 +187,10 @@ func processConfiguredPushAction(action *common.PushWebhookEvent, config *common return } - if stat, err := os.Stat(filepath.Join(git.GetPath(), gitPrj, action.Repository.Name)); err != nil || !stat.IsDir(){ + if stat, err := os.Stat(filepath.Join(git.GetPath(), gitPrj, action.Repository.Name)); err != nil { + git.GitExecOrPanic(gitPrj, "submodule", "--quiet", "add", "--depth", "1", action.Repository.Clone_Url, action.Repository.Name) + common.LogDebug("Pushed to package that is not part of the project. Re-adding...", err) + } else if !stat.IsDir() { common.LogError("Pushed to a package that is not a submodule but exists in the project. Ignoring.") return }