diff --git a/.github/workflows/arduino_lint.yml b/.github/workflows/arduino_lint.yml index acf7aa9..2a36783 100644 --- a/.github/workflows/arduino_lint.yml +++ b/.github/workflows/arduino_lint.yml @@ -22,7 +22,7 @@ jobs: - name: Find affected files run: | git fetch origin ${{ github.base_ref }} --depth=1 - git diff --name-only origin/${{ github.base_ref }} > affected_files.txt + git diff --diff-filter=ACM --name-only origin/${{ github.base_ref }} > affected_files.txt echo "Affected files:" cat affected_files.txt diff --git a/.github/workflows/bazel_build.yml b/.github/workflows/bazel_build.yml index ac51194..9b3e5d6 100644 --- a/.github/workflows/bazel_build.yml +++ b/.github/workflows/bazel_build.yml @@ -23,7 +23,7 @@ jobs: id: affected_files run: | git fetch origin ${{ github.base_ref }} --depth=1 - git diff --name-only origin/${{ github.base_ref }} > affected_files.txt + git diff --diff-filter=ACM --name-only origin/${{ github.base_ref }} > affected_files.txt echo "Affected files:" cat affected_files.txt diff --git a/.github/workflows/bazel_buildifier.yml b/.github/workflows/bazel_buildifier.yml index 53b6a97..baea69d 100644 --- a/.github/workflows/bazel_buildifier.yml +++ b/.github/workflows/bazel_buildifier.yml @@ -22,7 +22,7 @@ jobs: - name: Find affected files run: | git fetch origin ${{ github.base_ref }} --depth=1 - git diff --name-only origin/${{ github.base_ref }} > affected_files.txt + git diff --diff-filter=ACM --name-only origin/${{ github.base_ref }} > affected_files.txt echo "Affected files:" cat affected_files.txt diff --git a/.github/workflows/bazel_test.yml b/.github/workflows/bazel_test.yml index 6b639a9..617502c 100644 --- a/.github/workflows/bazel_test.yml +++ b/.github/workflows/bazel_test.yml @@ -23,7 +23,7 @@ jobs: id: affected_files run: | git fetch origin ${{ github.base_ref }} --depth=1 - git diff --name-only origin/${{ github.base_ref }} > affected_files.txt + git diff --diff-filter=ACM --name-only origin/${{ github.base_ref }} > affected_files.txt echo "Affected files:" cat affected_files.txt diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index cb36b2e..a69f95f 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -22,7 +22,7 @@ jobs: - name: Find affected files run: | git fetch origin ${{ github.base_ref }} --depth=1 - git diff --name-only origin/${{ github.base_ref }} > affected_files.txt + git diff --diff-filter=ACM --name-only origin/${{ github.base_ref }} > affected_files.txt echo "Affected files:" cat affected_files.txt diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index 0de7ab7..32f48ca 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -22,7 +22,7 @@ jobs: - name: Find affected files run: | git fetch origin ${{ github.base_ref }} --depth=1 - git diff --name-only origin/${{ github.base_ref }} > affected_files.txt + git diff --diff-filter=ACM --name-only origin/${{ github.base_ref }} > affected_files.txt echo "Affected files:" cat affected_files.txt diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index cac83d2..09a5ba6 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -23,7 +23,7 @@ jobs: id: affected_files run: | git fetch origin ${{ github.base_ref }} --depth=1 - git diff --name-only origin/${{ github.base_ref }} > affected_files.txt + git diff --diff-filter=ACM --name-only origin/${{ github.base_ref }} > affected_files.txt echo "Affected files:" cat affected_files.txt @@ -56,13 +56,15 @@ jobs: for target in $targets; do result=$(bazelisk cquery "kind('cc_test', deps('$target'))") || exit 1 - # Remove the part in parentheses (e.g., (f37096a)) - formatted_result=$(echo "$result" | sed 's/ ([^)]*)//g') + if [[ -n "$result" ]]; then + # Remove the part in parentheses (e.g., (f37096a)) + formatted_result=$(echo "$result" | sed 's/ ([^)]*)//g') - # Prefix each line of the result with a `-` - formatted_result=$(echo "$formatted_result" | sed 's/^/-/') + # Prefix each line of the result with a `-` + formatted_result=$(echo "$formatted_result" | sed 's/^/-/') - test_targets+="$formatted_result"$'\n' + test_targets+="$formatted_result"$'\n' + fi done echo "$test_targets" > test_targets.txt diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml index 883c050..4e41b3c 100644 --- a/.github/workflows/yamllint.yml +++ b/.github/workflows/yamllint.yml @@ -22,7 +22,7 @@ jobs: - name: Find affected files run: | git fetch origin ${{ github.base_ref }} --depth=1 - git diff --name-only origin/${{ github.base_ref }} > affected_files.txt + git diff --diff-filter=ACM --name-only origin/${{ github.base_ref }} > affected_files.txt echo "Affected files:" cat affected_files.txt