diff --git a/.github/workflows/compare-ds.yaml b/.github/workflows/compare-ds.yaml index c8908509865d..c05b95123828 100644 --- a/.github/workflows/compare-ds.yaml +++ b/.github/workflows/compare-ds.yaml @@ -83,7 +83,7 @@ jobs: body="${body//'%'/'%25'}" body="${body//$'\n'/'%0A'}" body="${body//$'\r'/'%0D'}" - echo ::set-output name=log::$body + echo ::set-output name=log::${body:0:65000} - name: Find Comment uses: peter-evans/find-comment@v1 id: fc @@ -92,7 +92,7 @@ jobs: comment-author: 'github-actions[bot]' body-includes: This datastream diff is auto generated by the check - name: Create or update comment - if: ${{ steps.compare_ds.outputs.COMPARE_DS_OUTPUT_SIZE != '0'}} + if: ${{ steps.compare_ds.outputs.COMPARE_DS_OUTPUT_SIZE != '0' && steps.compare_ds.outputs.COMPARE_DS_OUTPUT_SIZE <= 65000 }} uses: peter-evans/create-or-update-comment@v1 with: comment-id: ${{ steps.fc.outputs.comment-id }} @@ -106,6 +106,26 @@ jobs: ${{ steps.diff.outputs.log }} ``` + + edit-mode: replace + - name: Create or update a trimmed comment + if: ${{ steps.compare_ds.outputs.COMPARE_DS_OUTPUT_SIZE > 65000 }} + uses: peter-evans/create-or-update-comment@v1 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + This datastream diff is auto generated by the check `Compare DS/Generate Diff`. + Due to the excessive size of the diff, it has been trimmed to fit the 65535-character limit. +
+ Click here to see the trimmed diff + + ```diff + ${{ steps.diff.outputs.log }} + + ... The diff is trimmed here ... + ``` +
edit-mode: replace - name: Delete existing comment in case new commits trigger no changes in Compare DS tool