Skip to content

Commit

Permalink
Fix components being listed more than once. (#29)
Browse files Browse the repository at this point in the history
* Fix components being listed more than once.

* Add CHANGELOG entry
  • Loading branch information
DriesSchaumont authored Mar 6, 2024
1 parent a99a25f commit 2e6acdb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 4 additions & 5 deletions project/detect-changed-components/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2e6acdb

Please sign in to comment.