Skip to content

Commit f7bc465

Browse files
chore: sync files (#2146)
Signed-off-by: GitHub <noreply@github.com> Signed-off-by: GitHub <noreply@github.com> Co-authored-by: kenji-miyake <kenji-miyake@users.noreply.github.com>
1 parent 27b83b8 commit f7bc465

4 files changed

+79
-3
lines changed

.github/workflows/build-and-test-differential.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080

8181
- name: Get modified files
8282
id: get-modified-files
83-
uses: tj-actions/changed-files@v32
83+
uses: tj-actions/changed-files@v34
8484
with:
8585
files: |
8686
**/*.cpp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: clang-tidy-pr-comments-manually
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
workflow_run_id_or_url:
7+
description: The target workflow run ID or URL of the build-and-test-differential workflow
8+
required: true
9+
jobs:
10+
clang-tidy-pr-comments-manually:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out repository
14+
uses: actions/checkout@v3
15+
16+
- name: Download analysis results
17+
run: |
18+
workflow_run_id=$(echo "${{ inputs.workflow_run_id_or_url }}" | sed -e "s|.*runs/||" -e "s|/jobs.*||")
19+
gh run download "$workflow_run_id" -D /tmp || true
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Check if the fixes.yaml file exists
24+
id: check-fixes-yaml-existence
25+
uses: autowarefoundation/autoware-github-actions/check-file-existence@v1
26+
with:
27+
files: /tmp/clang-tidy-result/fixes.yaml
28+
29+
- name: Set variables
30+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
31+
id: set-variables
32+
run: |
33+
echo ::set-output name=pr-id::"$(cat /tmp/clang-tidy-result/pr-id.txt)"
34+
echo ::set-output name=pr-head-repo::"$(cat /tmp/clang-tidy-result/pr-head-repo.txt)"
35+
echo ::set-output name=pr-head-ref::"$(cat /tmp/clang-tidy-result/pr-head-ref.txt)"
36+
37+
- name: Check out PR head
38+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
39+
uses: actions/checkout@v3
40+
with:
41+
repository: ${{ steps.set-variables.outputs.pr-head-repo }}
42+
ref: ${{ steps.set-variables.outputs.pr-head-ref }}
43+
persist-credentials: false
44+
45+
- name: Replace paths in fixes.yaml
46+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
47+
run: |
48+
sed -i -e "s|/__w/|/home/runner/work/|g" /tmp/clang-tidy-result/fixes.yaml
49+
cat /tmp/clang-tidy-result/fixes.yaml
50+
51+
- name: Copy fixes.yaml to access from Docker Container Action
52+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
53+
run: |
54+
cp /tmp/clang-tidy-result/fixes.yaml fixes.yaml
55+
56+
- name: Run clang-tidy-pr-comments action
57+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
58+
uses: platisd/clang-tidy-pr-comments@v1
59+
with:
60+
github_token: ${{ secrets.GITHUB_TOKEN }}
61+
clang_tidy_fixes: fixes.yaml
62+
pull_request_id: ${{ steps.set-variables.outputs.pr-id }}

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

+13-2
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,53 @@ on:
99

1010
jobs:
1111
clang-tidy-pr-comments:
12-
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
12+
if: ${{ github.event.workflow_run.event == 'pull_request' && contains(fromJson('["success", "failure"]'), github.event.workflow_run.conclusion) }}
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Check out repository
1616
uses: actions/checkout@v3
1717

1818
- name: Download analysis results
1919
run: |
20-
gh run download ${{ github.event.workflow_run.id }} -D /tmp
20+
gh run download ${{ github.event.workflow_run.id }} -D /tmp || true
2121
env:
2222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2323

24+
- name: Check if the fixes.yaml file exists
25+
id: check-fixes-yaml-existence
26+
uses: autowarefoundation/autoware-github-actions/check-file-existence@v1
27+
with:
28+
files: /tmp/clang-tidy-result/fixes.yaml
29+
2430
- name: Set variables
31+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
2532
id: set-variables
2633
run: |
2734
echo ::set-output name=pr-id::"$(cat /tmp/clang-tidy-result/pr-id.txt)"
2835
echo ::set-output name=pr-head-repo::"$(cat /tmp/clang-tidy-result/pr-head-repo.txt)"
2936
echo ::set-output name=pr-head-ref::"$(cat /tmp/clang-tidy-result/pr-head-ref.txt)"
3037
3138
- name: Check out PR head
39+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
3240
uses: actions/checkout@v3
3341
with:
3442
repository: ${{ steps.set-variables.outputs.pr-head-repo }}
3543
ref: ${{ steps.set-variables.outputs.pr-head-ref }}
3644
persist-credentials: false
3745

3846
- name: Replace paths in fixes.yaml
47+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
3948
run: |
4049
sed -i -e "s|/__w/|/home/runner/work/|g" /tmp/clang-tidy-result/fixes.yaml
4150
cat /tmp/clang-tidy-result/fixes.yaml
4251
4352
- name: Copy fixes.yaml to access from Docker Container Action
53+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
4454
run: |
4555
cp /tmp/clang-tidy-result/fixes.yaml fixes.yaml
4656
4757
- name: Run clang-tidy-pr-comments action
58+
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
4859
uses: platisd/clang-tidy-pr-comments@v1
4960
with:
5061
github_token: ${{ secrets.GITHUB_TOKEN }}

.markdown-link-check.json

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
{
55
"pattern": "^http://localhost"
66
},
7+
{
8+
"pattern": "^http://127\\.0\\.0\\.1"
9+
},
710
{
811
"pattern": "^https://github.com/.*/discussions/new"
912
}

0 commit comments

Comments
 (0)