auto-comment icon indicating copy to clipboard operation
auto-comment copied to clipboard

Include an image in a comment

Open bpbond opened this issue 4 years ago • 2 comments
trafficstars

Hi, thanks for this useful bot. I'm interested in including an image in the auto-comment (e.g. PR diagnostics, generated from a script that's run in an earlier job in the workflow). Is this possible?

Expected Behavior

Something like this (just in terms of there being a comment with an image, don't mean Codecov specifically): Screen Shot 2021-09-29 at 12 32 58 PM

Possible Solution

I've done a lot of googling, but haven't found a good solution—would welcome advice!

Additional Context

Thank you! cc @leeyap

bpbond avatar Sep 29 '21 16:09 bpbond

👋 @bpbond Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.

github-actions[bot] avatar Sep 29 '21 16:09 github-actions[bot]

Hi, @urish The earlier job should output the image url, then we can embed the image in the comment.

ref: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idoutputs

name: Auto Comment
on: [issues, pull_request]
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: xxx/action-to-generate-images
         id: images
      - uses: wow-actions/auto-comment@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          pullRequestOpened: |
            👋 @{{ author }}
            Thank you for raising your pull request.
            ![image](${{ steps.images.outputs.url }})

bubkoo avatar Sep 30 '21 00:09 bubkoo