diff --git a/action.yaml b/action.yaml index 23c502c..8606f5d 100644 --- a/action.yaml +++ b/action.yaml @@ -88,16 +88,6 @@ runs: name: bundle path: ${{ inputs.analyze_directory }}/bundle_analysis.json - - name: Get Comment Body - shell: bash - id: get-comment-body - if: success() && github.event.number - # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings - run: | - echo "body<> $GITHUB_OUTPUT - echo "$(cat ${{ inputs.analyze_directory }}/bundle_analysis_comment.txt)" >> $GITHUB_OUTPUT - echo EOF >> $GITHUB_OUTPUT - - name: Find Comment uses: peter-evans/find-comment@v3 if: success() && github.event.number @@ -111,13 +101,13 @@ runs: if: success() && github.event.number && steps.fc.outputs.comment-id == 0 with: issue-number: ${{ github.event.number }} - body: ${{ steps.get-comment-body.outputs.body }} + body-path: ${{ inputs.analyze_directory }}/bundle_analysis_comment.txt - name: Update Comment uses: peter-evans/create-or-update-comment@v4 if: success() && github.event.number && steps.fc.outputs.comment-id != 0 with: issue-number: ${{ github.event.number }} - body: ${{ steps.get-comment-body.outputs.body }} + body-path: ${{ inputs.analyze_directory }}/bundle_analysis_comment.txt comment-id: ${{ steps.fc.outputs.comment-id }} edit-mode: replace diff --git a/src/compare.ts b/src/compare.ts index 82d45e8..a3c4836 100644 --- a/src/compare.ts +++ b/src/compare.ts @@ -84,16 +84,15 @@ This analysis was generated by [esbuild-bundle-analyzer](https://github.com/exoe if (!hasAnyChange && input.skipCommentIfEmpty) { output = ""; } + + // Log mostly for testing and debugging. + // This will show up in the github actions console. console.dir({ input, hasAnyChange, output, }); - // log the output, mostly for testing and debugging. this will show up in the - // github actions console. - console.log(output); - // Write the output to a file which is later read in // as comment contents by the actions workflow. fs.mkdirSync(path.join(process.cwd(), input.analyzerDirectory), {