@@ -274,6 +274,7 @@ jobs:
274
274
cpp_clang_tidy :
275
275
name : Clang Tidy Report
276
276
runs-on : ubuntu-latest
277
+ if : github.event_name == 'pull_request' # github.base_ref exists only for PRs
277
278
steps :
278
279
- name : Install Boost
279
280
run : |
@@ -285,13 +286,11 @@ jobs:
285
286
sudo apt install -y clang-tidy-15
286
287
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-15 100
287
288
288
- - name : ' PR Fetch Depth'
289
- run : echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
290
-
291
289
- name : Checkout sources
292
290
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
295
294
296
295
- name : Configure 3rd parties
297
296
run : >
@@ -309,7 +308,6 @@ jobs:
309
308
310
309
- name : Generate Clang Tidy Report (Modified C++ sources in PR)
311
310
id : clang-pr
312
- if : github.event_name == 'pull_request'
313
311
run : |
314
312
REPORT_NAME="clang_tidy_report_pr.txt"
315
313
REPORT_PATH="$PWD/${REPORT_NAME}"
@@ -324,7 +322,7 @@ jobs:
324
322
fi
325
323
326
324
- 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
328
326
uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3
329
327
with :
330
328
name : ${{ steps.clang-pr.outputs.report_name }}
0 commit comments