This is an automated email from the ASF dual-hosted git repository.

nfilotto pushed a commit to branch auto-generate-list-of-sub-components
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 7b4f138977eeb8e15ff6b458f69a26d38075ceb3
Author: Nicolas Filotto <nfilo...@talend.com>
AuthorDate: Fri Oct 13 17:24:33 2023 +0200

    (chore) ci: auto-generate list of submodules
---
 .github/actions/component-test/component-test.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/.github/actions/component-test/component-test.sh 
b/.github/actions/component-test/component-test.sh
index 68efe60e73a..282b06a1a84 100755
--- a/.github/actions/component-test/component-test.sh
+++ b/.github/actions/component-test/component-test.sh
@@ -34,12 +34,21 @@ function main() {
   for component in ${componentList}
   do
     if [[ ${component} = camel-* ]] ; then
-      pl="$pl,components/${component}"
+      componentPath="components/${component}"
     else
-      pl="$pl,components/camel-${component}"
+      componentPath="components/camel-${component}"
+    fi
+    if [[ -d "${componentPath}" ]] ; then
+      pl="$pl$(find "${componentPath}" -name pom.xml -exec dirname {} \; | 
sort | tr -s "\n" ",")"
     fi
   done
-  pl="${pl:1}"
+  len=${#pl}
+  if [[ "$len" -gt "0" ]] ; then
+    pl="${pl::len-1}"
+  else
+    echo "The components to test don't exist"
+    exit 1
+  fi
 
   if [[ ${fastBuild} = "true" ]] ; then
     echo "Launching a fast build against the projects ${pl} and their 
dependencies"

Reply via email to