From a7c916e50cb78a7fa4b870c95035f60270b76990 Mon Sep 17 00:00:00 2001 From: Jason Q <81179619+beqqrry-aws@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:38:04 -0700 Subject: [PATCH] GitHub: Changes the C++ linting workflow to allow it to be required. (#6155) --- .github/workflows/sd-cpp-lint.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sd-cpp-lint.yml b/.github/workflows/sd-cpp-lint.yml index ecaf47d302e..c2d68fc38a4 100644 --- a/.github/workflows/sd-cpp-lint.yml +++ b/.github/workflows/sd-cpp-lint.yml @@ -1,8 +1,6 @@ name: "cpp lint check" on: pull_request: - paths: - - 'cpp/**' workflow_dispatch: jobs: @@ -13,10 +11,19 @@ jobs: pull-requests: read runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout files + uses: actions/checkout@v4 with: - fetch-depth: 0 + sparse-checkout: | + .github + cpp + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v41 + with: + files: "cpp/**/*.{cpp,h}" - name: "Run clang-tidy check" + if: steps.changed-files.outputs.any_changed == 'true' uses: ./.github/sd-cpp-linter with: config_file: ./.github/cpp-linter/clang-tidy-config.txt