From 3ee6abf6107ccc2d8ee538de7ff6b1fb644f5d60 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sun, 26 Feb 2023 08:20:02 -0700 Subject: [PATCH] feat: add support for listing deleted submodules. (#1001) --- get-changed-paths.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/get-changed-paths.sh b/get-changed-paths.sh index 94fe149e458..1d732c17434 100755 --- a/get-changed-paths.sh +++ b/get-changed-paths.sh @@ -91,7 +91,14 @@ function get_diff() { echo "::warning::Failed to get changed files for submodule ($sub) between: ${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904} ${sub_commit_cur}. Please ensure that submodules are initialized and up to date. See: https://github.com/actions/checkout#usage" >&2 } fi - done < <(git submodule | awk '{print $2}') + done < <(git submodule status --recursive | grep -v "^-" | awk '{print $2}') + + + if [[ "$filter" == "D" ]]; then + while read -r sub; do + echo "$sub" + done < <(git submodule status --recursive | grep -e "^-" | awk '{print $2}') + fi git diff --diff-filter="$filter" --name-only --ignore-submodules=all "$base$DIFF$sha" && exit_status=$? || exit_status=$?