Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project/detect-changed-components: Fix realpath not being able to resolve changed files #39

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# viash-actions v6.3.2

## Bug fixes

* `project/detect-changed-components`: Fix realpath not being able to resolve changed files (PR #39).

# viash-actions v6.3.1

## Bug fixes
Expand Down
3 changes: 1 addition & 2 deletions pro/generate-documentation-qmd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ inputs:
wildcards to create a custom folder hierarchy for storing the output for different components
default: "{type}s/{namespace}/{name}.qmd"
clean:
type: boolean
required: false
default: false
default: "false"
description: >
Whether or not to start from a clean directory.
ref:
Expand Down
9 changes: 5 additions & 4 deletions project/detect-changed-components/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ runs:
# So we use delimiter ';' to read the file and trim the backslash from the end.
declare -a changed_files=()
trim_slash() {
line=$2
echo "Found changed file: $line"
changed_files[$1]="${line/%\\/}"
local line=$2
local trimmed_line=${line/%\\/}
echo "Found changed file: '$trimmed_line'"
changed_files[$1]="${trimmed_line}"
}
# read changed files as array
readarray -d ';' -C trim_slash -c 1 -t <<< "${{ steps.changed-files.outputs.all_changed_files }}"
Expand Down Expand Up @@ -153,7 +154,7 @@ runs:
fi
echo "All resources including files from directories: ${resource_arr[@]}"
for changed_file in ${changed_files[@]}; do
changed_file_real_path=$(realpath "$changed_file")
changed_file_real_path="$(pwd)/${changed_file}"
for resource_to_check in ${resource_arr[@]}; do
if [ "$changed_file_real_path" = "$resource_to_check" ]; then
echo "Detected changed component!"
Expand Down