diff --git a/action.yml b/action.yml index d04e2ee2..e62834b1 100644 --- a/action.yml +++ b/action.yml @@ -72,7 +72,9 @@ runs: git fetch --depth=1 origin "${TARGET_BRANCH}":"${TARGET_BRANCH}" HEAD_SHA=$(git rev-parse "${TARGET_BRANCH}" || true) fi + echo "Using head sha: $HEAD_SHA..." + if [[ -z "$INPUT_FILES" ]]; then echo "Getting diff..." ADDED=$(git diff --diff-filter=A --name-only "$HEAD_SHA" | tr "\n" "$INPUT_SEPARATOR" | sed -E "s/($INPUT_SEPARATOR)$//") @@ -96,6 +98,7 @@ runs: UNKNOWN_ARRAY=() ALL_CHANGED_ARRAY=() ALL_MODIFIED_FILES_ARRAY=() + for path in ${INPUT_FILES} do echo "Checking for file changes: \"${path}\"..." @@ -122,7 +125,6 @@ runs: UNKNOWN=$(echo "${UNKNOWN_ARRAY[@]}" | sed -E "s/($INPUT_SEPARATOR)$//" | xargs) ALL_CHANGED=$(echo "${ALL_CHANGED_ARRAY[@]}" | sed -E "s/($INPUT_SEPARATOR)$//" | xargs) ALL_MODIFIED_FILES=$(echo "${ALL_MODIFIED_FILES_ARRAY[@]}" | sed -E "s/($INPUT_SEPARATOR)$//" | xargs) - fi echo "Added files: $ADDED" @@ -165,6 +167,7 @@ runs: echo "::set-output name=any_changed::false" fi fi + echo "::set-output name=added_files::$ADDED" echo "::set-output name=copied_files::$COPIED" echo "::set-output name=deleted_files::$DELETED"