From 2e6acdb7795ede21e03766538959a3d6c91b5db9 Mon Sep 17 00:00:00 2001 From: Dries Schaumont <5946712+DriesSchaumont@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:39:12 +0100 Subject: [PATCH] Fix components being listed more than once. (#29) * Fix components being listed more than once. * Add CHANGELOG entry --- CHANGELOG.md | 6 ++++++ project/detect-changed-components/action.yml | 9 ++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8db26da..16896d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# viash-actions v5.3.1 + +## Bug fixes + +* `project/detect-changed-components`: Fix components being listed more than once (PR #29). + # viash-actions v5.3.0 ## New functionality diff --git a/project/detect-changed-components/action.yml b/project/detect-changed-components/action.yml index 3ebe041..a873898 100644 --- a/project/detect-changed-components/action.yml +++ b/project/detect-changed-components/action.yml @@ -104,6 +104,7 @@ runs: ' <<< "$component" ) # check if resource is in the list of changed resources + should_add_component=0 for resource in "${resources[@]}"; do echo "Checking resource: $resource" if [ ! -e "$resource" ]; then @@ -121,7 +122,6 @@ runs: fi echo "All resources including files from directories: ${resource_arr[@]}" for changed_file in ${changed_files[@]}; do - should_add_component=0 changed_file_real_path=$(realpath "$changed_file") echo "Using changed file: $changed_file_real_path" for resource_to_check in ${resource_arr[@]}; do @@ -131,12 +131,11 @@ runs: break fi done - if [[ "$should_add_component" -eq 1 ]]; then - output_array+="$component" - break - fi done done + if [[ "$should_add_component" -eq 1 ]]; then + output_array+="$component" + fi done # reformat as json and write to file