1616 ARTIFACTS : ${{ env.ARTIFACTS }}
1717 SUB_ARCHES : ${{ env.SUB_ARCHES }}
1818 steps :
19+ - name : Create or update bot comment on PR
20+ if : ${{ github.event_name == 'pull_request' }}
21+ env :
22+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
23+ GH_REPO : ${{ github.repository }}
24+ BODY : |
25+ ### :gear: CI started on this PR. Follow the progress here.
26+ run :
27+ gh pr comment ${{ github.event.pull_request.number }} --edit-last --body "${BODY}"
28+ [ $? -ne 0 ] && gh pr comment ${{ github.event.pull_request.number }} --body "${BODY}"
29+
1930 - name : Install OS dependencies
2031 working-directory : /opt
2132 run : |
@@ -308,11 +319,23 @@ jobs:
308319 pattern : " *-report-*"
309320 merge-multiple : true
310321
311- # Collect and summarize logs, will fail the step if any test failed
322+ # Collect and summarize logs
312323 - run : |
313324 extra/ci_inspect_logs.py result summary full_log
314325 echo "CI_RESULT=$(cat result)" > $GITHUB_OUTPUT
315- cat summary full_log > $GITHUB_STEP_SUMMARY
326+ if ${{ github.event_name != 'pull_request' && 'true' || 'false' }}; then
327+ cat summary >> $GITHUB_STEP_SUMMARY
328+ fi
329+ cat full_log >> $GITHUB_STEP_SUMMARY
330+
331+ - name : Leave summary comment on PR
332+ if : ${{ github.event_name == 'pull_request' }}
333+ env :
334+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
335+ GH_REPO : ${{ github.repository }}
336+ run :
337+ gh pr comment ${{ github.event.pull_request.number }} --edit-last --body-file summary
338+ [ $? -ne 0 ] && gh pr comment ${{ github.event.pull_request.number }} --edit-last --body-file summary
316339
317340 - name : Clean up intermediate artifacts
318341 uses : geekyeggo/delete-artifact@v5.1.0
@@ -332,7 +355,7 @@ jobs:
332355 steps :
333356 - name : CI run result
334357 run : |
335- exit ${{ needs.inspect-logs.CI_RESULT == 'PASSED' && !( contains(needs.*.result, 'failure')) && '0' || '1' }}
358+ exit ${{ (( needs.inspect-logs.CI_RESULT == 'PASSED') && !contains(needs.*.result, 'failure')) && '0' || '1' }}
336359
337360 publish-core :
338361 name : Publish core
0 commit comments