3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-16 19:27:39 +00:00
changed-files/sourcefiles.sh
2021-09-04 09:08:20 -04:00

26 lines
612 B
Bash

#!/usr/bin/env bash
set -e
echo "::group::changed-files-from-source-file"
IFS=" " read -r -a FILES <<< "$(echo "${INPUT_FILES[@]}" | sort -u | tr "\n" " ")"
if [[ -n $INPUT_FILES_FROM_SOURCE_FILE ]]; then
for file in $INPUT_FILES_FROM_SOURCE_FILE
do
while read -r fileName; do
FILES+=("$fileName")
done <"$file"
done
fi
echo "Input Files: ${FILES[*]}"
IFS=" " read -r -a ALL_UNIQUE_FILES <<< "$(echo "${FILES[@]}" | tr " " "\n" | sort -u | tr "\n" " ")"
echo "All Unique Input files: ${ALL_UNIQUE_FILES[*]}"
echo "::set-output name=files::${ALL_UNIQUE_FILES[*]}"
echo "::endgroup::"