marocchino / sticky-pull-request-comment

create comment on pull request, if exists update that comment.
MIT License
438 stars 79 forks source link

Warning on hiding already hidden comment #1082

Open richja opened 1 year ago

richja commented 1 year ago

Similar to #559, when using hide: true and comment is already hidden, I am getting a warning: Comment body cannot be blank

Run marocchino/sticky-pull-request-comment@v2
  with:
    hide: true
    hide_classify: RESOLVED
    header: ***
    append: false
    recreate: false
    delete: false
    only_create: false
    only_update: false
    hide_details: false
    hide_and_recreate: false
    ignore_empty: false
    skip_unchanged: false
    follow_symbolic_links: false
    GITHUB_TOKEN: ***
  env:
    URL: https://api.github.com/repos/***/issues/564/comments
Warning: Comment body cannot be blank

Warning doesn't show up when a comment is not hidden yet.

fregante commented 6 months ago

In my case, the comment isn't hidden at run time, I get the warning, and it doesn't get hidden by the end of the action run. It seems that hide: true as documented in the readme is broken:

https://github.com/marocchino/sticky-pull-request-comment/tree/v2/?tab=readme-ov-file#hide-previous-comment

I'm using


      - if: steps.stats.outputs.changes <= 1000
        uses: marocchino/sticky-pull-request-comment@v2
        with:
          header: lockfile # Unique identifier for the comment
          hide: true
      - if: steps.stats.outputs.changes > 1000
        uses: marocchino/sticky-pull-request-comment@v2
        with:
          header: lockfile # Unique identifier for the comment
          recreate: true
          message: |
            ## ⚠️ Large diff for package-lock.json

Live example https://togithub.com/pixiebrix/pixiebrix-extension/pull/7734#issuecomment-1968463512 Log (for the next 30 days) https://github.com/pixiebrix/pixiebrix-extension/actions/runs/8077604169/job/22068226398?pr=7734