From 58e377c3755eed96dc050f487f3c8afde26cd267 Mon Sep 17 00:00:00 2001 From: "Y.Hisaki" Date: Thu, 28 Nov 2024 14:16:57 +0900 Subject: [PATCH] update Signed-off-by: Y.Hisaki --- clang-tidy/action.yaml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/clang-tidy/action.yaml b/clang-tidy/action.yaml index 66549d94..9f28ba24 100644 --- a/clang-tidy/action.yaml +++ b/clang-tidy/action.yaml @@ -11,6 +11,9 @@ inputs: target-packages: description: "" required: true + target-files: + description: "" + required: false build-depends-repos: description: "" required: false @@ -103,18 +106,21 @@ runs: - name: Get target files id: get-target-files run: | - read -ra target_packages <<< "${{ inputs.target-packages }}" - mapfile -t package_paths < <(colcon list --paths-only --packages-select "${target_packages[@]}") - ignore_patterns=() - ignore_patterns+=( -not -path "*/test/*" ) - if [ -f .clang-tidy-ignore ]; then - while IFS= read -r pattern; do - ignore_patterns+=( -not -path "$pattern" ) - done < .clang-tidy-ignore - fi - target_files=$(find "${package_paths[@]}" -type f \( -name '*.cpp' \) "${ignore_patterns[@]}" | tr '\n' ' ') - echo "target-files=$target_files" - echo "target-files=$target_files" >> $GITHUB_OUTPUT + if [ "${{ inputs.target-files }}" != "" ]; then + target_files="${{ inputs.target-files }}" + else + read -ra target_packages <<< "${{ inputs.target-packages }}" + mapfile -t package_paths < <(colcon list --paths-only --packages-select "${target_packages[@]}") + ignore_patterns=() + ignore_patterns+=( -not -path "*/test/*" ) + if [ -f .clang-tidy-ignore ]; then + while IFS= read -r pattern; do + ignore_patterns+=( -not -path "$pattern" ) + done < .clang-tidy-ignore + fi + target_files=$(find "${package_paths[@]}" -name '*.cpp' "${ignore_patterns[@]}" | tr '\n' ' ') + echo "target-files=$target_files" + echo "target-files=$target_files" >> $GITHUB_OUTPUT shell: bash - name: Analyze