1+ # This file is automatically synced from:
2+ # https://github.com/autowarefoundation/sync-file-templates
3+ # To make changes, update the source repository and follow the guidelines in its README.
4+
15name : clang-tidy-pr-comments
26
37on :
711 types :
812 - completed
913
14+ concurrency :
15+ group : ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
16+ cancel-in-progress : true
17+
1018jobs :
1119 clang-tidy-pr-comments :
12- if : ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
13- runs-on : ubuntu-latest
20+ if : ${{ github.event.workflow_run.event == 'pull_request' && contains(fromJson('["success", "failure"]'), github.event.workflow_run.conclusion) }}
21+ runs-on : ubuntu-22.04
1422 steps :
1523 - name : Check out repository
1624 uses : actions/checkout@v4
1725
1826 - name : Download analysis results
1927 run : |
20- gh run download ${{ github.event.workflow_run.id }} -D /tmp
28+ gh run download ${{ github.event.workflow_run.id }} -D /tmp || true
2129 env :
2230 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2331
32+ - name : Check if the fixes.yaml file exists
33+ id : check-fixes-yaml-existence
34+ uses : autowarefoundation/autoware-github-actions/check-file-existence@v1
35+ with :
36+ files : /tmp/clang-tidy-result/fixes.yaml
37+
2438 - name : Set variables
39+ if : ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
2540 id : set-variables
2641 run : |
27- echo ::set-output name= pr-id::" $(cat /tmp/clang-tidy-result/pr-id.txt)"
28- echo ::set-output name= pr-head-repo::" $(cat /tmp/clang-tidy-result/pr-head-repo.txt)"
29- echo ::set-output name= pr-head-ref::" $(cat /tmp/clang-tidy-result/pr-head-ref.txt)"
42+ echo " pr-id= $(cat /tmp/clang-tidy-result/pr-id.txt)" >> $GITHUB_OUTPUT
43+ echo " pr-head-repo= $(cat /tmp/clang-tidy-result/pr-head-repo.txt)" >> $GITHUB_OUTPUT
44+ echo " pr-head-ref= $(cat /tmp/clang-tidy-result/pr-head-ref.txt)" >> $GITHUB_OUTPUT
3045
3146 - name : Check out PR head
47+ if : ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
3248 uses : actions/checkout@v4
3349 with :
3450 repository : ${{ steps.set-variables.outputs.pr-head-repo }}
3551 ref : ${{ steps.set-variables.outputs.pr-head-ref }}
3652 persist-credentials : false
3753
3854 - name : Replace paths in fixes.yaml
55+ if : ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
3956 run : |
4057 sed -i -e "s|/__w/|/home/runner/work/|g" /tmp/clang-tidy-result/fixes.yaml
4158 cat /tmp/clang-tidy-result/fixes.yaml
4259
4360 - name : Copy fixes.yaml to access from Docker Container Action
61+ if : ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
4462 run : |
4563 cp /tmp/clang-tidy-result/fixes.yaml fixes.yaml
4664
4765 - name : Run clang-tidy-pr-comments action
66+ if : ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
4867 uses : platisd/clang-tidy-pr-comments@v1
4968 with :
5069 github_token : ${{ secrets.GITHUB_TOKEN }}
5170 clang_tidy_fixes : fixes.yaml
52- pull_request_id : ${{ steps.set-variables.outputs.pr-id }}
71+ pull_request_id : ${{ steps.set-variables.outputs.pr-id }}
0 commit comments