Closed idzm closed 11 months ago
:thinking: Don't know... Assuming there's a large pull request, which includes discussions etc, it will not be obvious which version of the code the report is about. Additionally, any "progress" will not be visible either.
On what events are you having the Action triggered? My recommendation would be to trigger it only based on a keyword/comment to decrease the spam.
Action is triggered by pull_request
event. Many services (codecov, sonarcloud) reuse previous comment. To save history we can just rewrite previous comment.
Sonarcloud seems to leave new comments, at least in the configuration I have:
Codecov seems to be reusing the same comment:
My suggestion is to make this an opt-in feature via a property in the yml
file.
E.g., one_comment: true
which defaults to false
:
name: Duplicate code
on: pull_request
jobs:
duplicate-code-check:
name: Check for duplicate code
runs-on: ubuntu-20.04
steps:
- name: Check for duplicate code
uses: platisd/duplicate-code-detection-tool@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
one_comment: true
directories: "src/, test/ut"
Feel free to submit a pull request that provides this feature. :100:
It better to reuse (overwrite) existing comment (which starts with
Duplicate code detection tool report
) to avoid being overloaded by bot comments.