woocommerce/plugins/woocommerce-blocks/.github/comments-aggregator
Tung Du da4221a9a7 Fix: workflows using comment-aggregator are failing on trunk (https://github.com/woocommerce/woocommerce-blocks/pull/8010) 2022-12-21 23:30:25 +07:00
..
README.md Fix: workflows using comment-aggregator are failing on trunk (https://github.com/woocommerce/woocommerce-blocks/pull/8010) 2022-12-21 23:30:25 +07:00
action.yml Fix: workflows using comment-aggregator are failing on trunk (https://github.com/woocommerce/woocommerce-blocks/pull/8010) 2022-12-21 23:30:25 +07:00
index.js Fix: workflows using comment-aggregator are failing on trunk (https://github.com/woocommerce/woocommerce-blocks/pull/8010) 2022-12-21 23:30:25 +07:00
screenshot.png Create merge comments action (https://github.com/woocommerce/woocommerce-blocks/pull/7973) 2022-12-21 22:24:01 +07:00
utils.js Fix: workflows using comment-aggregator are failing on trunk (https://github.com/woocommerce/woocommerce-blocks/pull/8010) 2022-12-21 23:30:25 +07:00

README.md

comments-aggregator

This GitHub Action helps you keep the PR page clean by merging comments/reports by multiple workflows into a single comment.

screenshot

Usage

This action is meant to be used as the poster/commenter. Instead of having existing actions post the comment by themselves, set those comments as the action output, then feed that output to comments-aggregator to let this action manage those comments for you.

      - name: Compare Assets
        uses: ./.github/compare-assets
        id: compare-assets
        with:
          repo-token: '${{ secrets.GITHUB_TOKEN }}'
          compare: assets-list/assets.json
          create-comment: false
      - name: Append report
        uses: ./.github/comments-aggregator
        with:
          repo-token: '${{ secrets.GITHUB_TOKEN }}'
          section-id: compare-assets-with-trunk
          content: ${{steps.compare-assets.outputs.comment}}

Inputs

  • repo-token (required): This is the GitHub token. This is required to manipulate PR comments.
  • section-id (required): The unique ID that helps this action to update the correct part of the aggregated comment.
  • content (option): The comment content. Default to empty. If nothing was provided, this action will stop gracefully.
  • order (optional): The order of the comment part inside the aggregated comment. Default to 10.

More examples

Message contains GitHub Event properties

      - name: Add release ZIP URL as comment to the PR
        uses: ./.github/comments-aggregator
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          section-id: release-zip-url
          order: 1
          content: |
            The release ZIP for this PR is accessible via:
            ```
            https://wcblocks.wpcomstaging.com/wp-content/uploads/woocommerce-gutenberg-products-block-${{ github.event.pull_request.number }}.zip
            ```