Skip to content

Commit fc6491b

Browse files
committed
clang tidy
Signed-off-by: Damien Jeandemange <[email protected]>
1 parent d450945 commit fc6491b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Diff for: .github/workflows/dev-ci.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ jobs:
274274
cpp_clang_tidy:
275275
name: Clang Tidy Report
276276
runs-on: ubuntu-latest
277+
if: github.event_name == 'pull_request' # github.base_ref exists only for PRs
277278
steps:
278279
- name: Install Boost
279280
run: |
@@ -285,13 +286,11 @@ jobs:
285286
sudo apt install -y clang-tidy-15
286287
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-15 100
287288
288-
- name: 'PR Fetch Depth'
289-
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
290-
291289
- name: Checkout sources
292290
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
293-
with:
294-
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
291+
run: |
292+
git fetch --no-tags --depth=1 origin ${{ github.base_ref }}
293+
git show-ref
295294
296295
- name: Configure 3rd parties
297296
run: >
@@ -309,7 +308,6 @@ jobs:
309308
310309
- name: Generate Clang Tidy Report (Modified C++ sources in PR)
311310
id: clang-pr
312-
if: github.event_name == 'pull_request'
313311
run: |
314312
REPORT_NAME="clang_tidy_report_pr.txt"
315313
REPORT_PATH="$PWD/${REPORT_NAME}"
@@ -324,7 +322,7 @@ jobs:
324322
fi
325323
326324
- name: Upload Clang Tidy Report (Modified C++ sources in PR)
327-
if: github.event_name == 'pull_request' && steps.clang-pr.outputs.report_exists
325+
if: steps.clang-pr.outputs.report_exists
328326
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3
329327
with:
330328
name: ${{ steps.clang-pr.outputs.report_name }}

0 commit comments

Comments
 (0)