cpp-linter / cpp-linter-action

A Github Action for linting C/C++ code integrating clang-tidy and clang-format to collect feedback provided in the form of file-annotations, thread-comments, workflow step-summary, and Pull Request reviews.

Home Page:https://cpp-linter.github.io/cpp-linter-action/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update thread comment once format checks are successful.

pshriwise opened this issue · comments

Thank you for providing this really handy action! When trying it out, I found that the thread comment would update if new/different problems with the formatting appear. It would be nice if the action also updated the comment when the format checks are successful to avoid confusion about outstanding formatting issues in the PR content.

Here is the set of options I'm using w/ v2:

          style: file
          files-changed-only: true
          tidy-checks: '-*'
          version: '15'
          thread-comments: true
          file-annotations: false
          step-summary: true
          extensions: 'cpp,h'

It should auto-update the thread comment if the event trigger is a PR (ie PR sync event). However, if you trigger cpp-linter with a push event, then the comment might not auto-update in the PR thread.

In our workflows (and maybe most), the PR is going to be updated by a push to the feature branch. Is there a technical barrier to ensuring that the thread comment is updated for push events?

Is there a technical barrier to ensuring that the thread comment is updated for push events?

Each event has a comments_url associated with the event type, using GitHub's REST API. A push event's comments_url only gives the comments for the commit's thread. A PR event's comments_url only gives the comments for PR's thread.

Personally I prefer file-annotations or the newer step-summary features because there's no risk of duplication and you always see results that are relevant to the event or workflow run.

Ah I see. Thanks for explaining. I think the file-annotations will be sufficient for our needs and do seem to update as expected. Thanks for your time!