Skip to content

Commit 9267b2f

Browse files
authored
fix(ci): fix clang-tidy-pr-comments workflow trigger (#12436)
* fix(ci): fix clang-tidy-pr-comments workflow trigger The workflow was listening for `build-and-test-differential` which is a reusable workflow (workflow_call). The workflow_run trigger only fires for top-level workflows. Changed to `build-test-tidy-pr` which is the actual top-level PR workflow. Also modernized the workflow: removed the rosdistro matrix (no longer needed), updated to ubuntu-latest and actions/checkout@v6, and made artifact pattern rosdistro-agnostic. Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
1 parent 187982d commit 9267b2f

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

.github/workflows/clang-tidy-pr-comments-manually.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
workflow_run_id_or_url:
7-
description: The target workflow run ID or URL of the build-and-test-differential workflow
7+
description: The target workflow run ID or URL of the build-test-tidy-pr workflow
88
required: true
99

1010
concurrency:
@@ -13,14 +13,10 @@ concurrency:
1313

1414
jobs:
1515
clang-tidy-pr-comments-manually:
16-
runs-on: ubuntu-22.04
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
rosdistro: [humble, jazzy]
16+
runs-on: ubuntu-latest
2117
steps:
2218
- name: Check out repository
23-
uses: actions/checkout@v4
19+
uses: actions/checkout@v6
2420

2521
- name: Extract workflow run ID
2622
id: extract-run-id
@@ -29,14 +25,14 @@ jobs:
2925
3026
- name: Download analysis results
3127
run: |
32-
gh run download "${{ steps.extract-run-id.outputs.workflow-run-id }}" -D /tmp -p 'clang-tidy-result-${{ matrix.rosdistro }}*' || true
28+
gh run download "${{ steps.extract-run-id.outputs.workflow-run-id }}" -D /tmp -p 'clang-tidy-result-*' || true
3329
env:
3430
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3531

3632
- name: Find clang-tidy result directory
3733
id: find-result-dir
3834
run: |
39-
result_dir=$(find /tmp -maxdepth 1 -type d -name 'clang-tidy-result-${{ matrix.rosdistro }}*' | head -1)
35+
result_dir=$(find /tmp -maxdepth 1 -type d -name 'clang-tidy-result-*' | head -1)
4036
echo "result-dir=$result_dir" >> $GITHUB_OUTPUT
4137
shell: bash
4238

@@ -58,7 +54,7 @@ jobs:
5854
5955
- name: Check out PR head
6056
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
61-
uses: actions/checkout@v4
57+
uses: actions/checkout@v6
6258
with:
6359
repository: ${{ steps.set-variables.outputs.pr-head-repo }}
6460
ref: ${{ steps.set-variables.outputs.pr-head-ref }}

.github/workflows/clang-tidy-pr-comments.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: clang-tidy-pr-comments
33
on:
44
workflow_run:
55
workflows:
6-
- build-and-test-differential
6+
- build-test-tidy-pr
77
types:
88
- completed
99

@@ -14,25 +14,21 @@ concurrency:
1414
jobs:
1515
clang-tidy-pr-comments:
1616
if: ${{ github.event.workflow_run.event == 'pull_request' && contains(fromJson('["success", "failure"]'), github.event.workflow_run.conclusion) }}
17-
runs-on: ubuntu-22.04
18-
strategy:
19-
fail-fast: false
20-
matrix:
21-
rosdistro: [humble, jazzy]
17+
runs-on: ubuntu-latest
2218
steps:
2319
- name: Check out repository
24-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
2521

2622
- name: Download analysis results
2723
run: |
28-
gh run download ${{ github.event.workflow_run.id }} -D /tmp -p 'clang-tidy-result-${{ matrix.rosdistro }}*' || true
24+
gh run download ${{ github.event.workflow_run.id }} -D /tmp -p 'clang-tidy-result-*' || true
2925
env:
3026
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3127

3228
- name: Find clang-tidy result directory
3329
id: find-result-dir
3430
run: |
35-
result_dir=$(find /tmp -maxdepth 1 -type d -name 'clang-tidy-result-${{ matrix.rosdistro }}*' | head -1)
31+
result_dir=$(find /tmp -maxdepth 1 -type d -name 'clang-tidy-result-*' | head -1)
3632
echo "result-dir=$result_dir" >> $GITHUB_OUTPUT
3733
shell: bash
3834

@@ -54,7 +50,7 @@ jobs:
5450
5551
- name: Check out PR head
5652
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
57-
uses: actions/checkout@v4
53+
uses: actions/checkout@v6
5854
with:
5955
repository: ${{ steps.set-variables.outputs.pr-head-repo }}
6056
ref: ${{ steps.set-variables.outputs.pr-head-ref }}

0 commit comments

Comments
 (0)