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.
https://cpp-linter.github.io/cpp-linter-action/
MIT License
91 stars 21 forks source link

cpp-linter workflows runs for every change #205

Closed shenxianpeng closed 6 months ago

shenxianpeng commented 6 months ago

I guess your change here was to disable all cpp-linter runs only run when there is a change under docs/examples/demo/

https://github.com/cpp-linter/cpp-linter-action/blob/7ce9dc29bcbc91876bb1548b691fc96156981d8b/.github/workflows/cpp-linter.yml#L6

but right now, it seems cpp-linter runs and adds comments for everything. see https://github.com/cpp-linter/cpp-linter-action/commit/7ce9dc29bcbc91876bb1548b691fc96156981d8b#comments

2bndy5 commented 6 months ago

yes, that was the idea. But it didn't seem to work as expected. Maybe if we just remove that line, it would only run when there are changes to the demo sources.

github docs for on.<event>.path

Currently we are only using that workflow to show an example badge in the README. We don't often modify the demo sources. So, how useful it is to even have both the CI workflow and the demo sources in this repo?

shenxianpeng commented 6 months ago

yes, that was the idea. But it didn't seem to work as expected. Maybe if we just remove that line, it would only run when there are changes to the demo sources.

I think just remove it should be work.

2bndy5 commented 6 months ago

We should also disable thread-comments for that workflow. That way we are less bothered by the posted comment.

shenxianpeng commented 6 months ago

Currently we are only using that workflow to show an example badge in the README. We don't often modify the demo sources. So, how useful it is to even have both the CI workflow and the demo sources in this repo?

Right. leave it there could as user's actual example and an example badge

2bndy5 commented 6 months ago

It might be getting triggered from master branch not main branch.

2bndy5 commented 6 months ago

Oh, I see. Actually, the comment comes from the test CI workflow which calls the test repo's reusable workflow.

So, maybe we don't run the test CI on push events?

shenxianpeng commented 6 months ago

So, maybe we don't run the test CI on push events?

That should be fine.

2bndy5 commented 6 months ago

yep. that fixed it 🎉

2bndy5 commented 6 months ago

That change in 57cc38b62414a9cff629f90220851e18f80ee5ea might also fix the problem where the latest tag was pointing to the PR's base branch tip (instead of the PR's head branch tip).