diff --git a/.github/actions/coverage/action.yml b/.github/actions/coverage/action.yml index 55a4abae7..78c2dc5e1 100644 --- a/.github/actions/coverage/action.yml +++ b/.github/actions/coverage/action.yml @@ -106,17 +106,6 @@ runs: name: ${{ steps.get-cov-report.outputs.report }} path: ${{ steps.get-cov-report.outputs.path }} - - name: 'Create code coverage report and comment' - run: | - if [ -n "${{ inputs.reset-commit-id }}" ];then - title="Base Code Coverage Report" - else - title="Current PR Code Coverage Report" - fi - content=$(echo "for detail, [goto summary](https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{github.run_id}}) download Artifacts \`${{ steps.get-cov-report.outputs.report }}\`") - curl -L -X POST "https://api.github.com/repos/${{github.repository}}/issues/${{github.event.pull_request.number}}/comments" -H "Authorization: Bearer ${{github.token}}" -H 'Content-Type: application/json' -d "{\"body\": \"${title}\\n$content}\"" - shell: bash - - name: 'Checkout source code' uses: actions/checkout@v4 if: ${{ inputs.reset-commit-id }} != "" diff --git a/.github/workflows/linux_llvm_cov.yml b/.github/workflows/linux_llvm_cov.yml index 20a9276bc..e77189471 100644 --- a/.github/workflows/linux_llvm_cov.yml +++ b/.github/workflows/linux_llvm_cov.yml @@ -87,6 +87,11 @@ jobs: - cov-test runs-on: ubuntu-22.04 steps: + - name: 'Create comment' + run: | + content=$(echo "for detail, [goto summary](https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{github.run_id}}) download Artifacts \`base-ylt-cov-report\`(base commit coverage report) and \`ylt-cov-report\`(current pull request coverage report)") + curl -L -X POST "https://api.github.com/repos/${{github.repository}}/issues/${{github.event.pull_request.number}}/comments" -H "Authorization: Bearer ${{github.token}}" -H 'Content-Type: application/json' -d "{\"body\": \"$content}\"" + shell: bash - name: 'Compare data' run: | sudo apt install -y bc