Skip to content

Commit

Permalink
Fix changed components not being detected. (#25)
Browse files Browse the repository at this point in the history
* Fix changed components not being detected.

* Undo changes to delimiter

* Update CHANGELOG
  • Loading branch information
DriesSchaumont authored Feb 22, 2024
1 parent d031fa7 commit 02e2ae5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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.2.1

## Bug Fixes

* `project/detect-changed-components`: fix changed components not being detected after updating `tj-actions/changed-files` (PR #25).

# viash-actions v5.2.0

## Minor changes
Expand Down
9 changes: 8 additions & 1 deletion project/detect-changed-components/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,15 @@ runs:
# create output array
declare -a output_array=()
# The output from changed-files is delimited by \;
# So we use delimiter ';' to read the file and trim the backslash from the end.
declare -a changed_files=()
trim_slash() {
line=$2
changed_files[$1]="${line/%\\/}"
}
# read changed files as array
IFS=$';' read -a changed_files <<< "${{ steps.changed-files.outputs.all_changed_files }}"
readarray -d ';' -C trim_slash -c 1 -t <<< "${{ steps.changed-files.outputs.all_changed_files }}"
# read components as array
readarray -t components < <(jq -c '.[]' "${{ inputs.input_file }}")
Expand Down

0 comments on commit 02e2ae5

Please sign in to comment.