lucassabreu / comment-coverage-clover

Github Action that automatically adds a comment with a summary of coverage reports (clover)
https://github.com/marketplace/actions/coverage-report-as-comment-clover
15 stars 4 forks source link

Posting comment multiple times #35

Closed klippx closed 1 year ago

klippx commented 1 year ago

https://github.com/lucassabreu/comment-coverage-clover/blob/main/CHANGELOG.md#001---2021-08-15 According to v0.0.1 (initial release) this action should not post multiple comments on the same PR.

Yet, it posts a new comment on every push. I expected it to keep it to 1 comment and keep that one comment updated instead.

Is this a regression?

Example:

Screenshot 2023-05-24 at 16 25 04
lucassabreu commented 1 year ago

hi @klippx could you share your step here?

my other projects still work so it must be your params, or a new bug

klippx commented 1 year ago
jobs:
  tests:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v3
      with:
        token: '${{ secrets.GH_PAT }}'
        fetch-depth: 0

    - uses: actions/setup-node@v3
      with:
        node-version: '18'

    - name: yarn install
      run: yarn install --immutable --immutable-cache

    - name: Run tests
      env:
        LOG_LEVEL: 'debug'
      run: |
        cd dgs/${{ inputs.service_name }}
        yarn test

    - name: Coverage Report as Comment (Clover)
      uses: lucassabreu/comment-coverage-clover@v0.3.0
      with:
        github-token: '${{ secrets.GH_PAT }}'
        file: ./dgs/${{ inputs.service_name }}/coverage/clover.xml
        dir-prefix-keep: dgs/${{ inputs.service_name }}
lucassabreu commented 1 year ago

just to be sure, you could update the action to use the 0.9.2 version?

maybe i fixed this problem since then.

https://github.com/lucassabreu/comment-coverage-clover/releases/tag/v0.9.2

lucassabreu commented 1 year ago

hi @klippx were you able to test it with the newest version?

klippx commented 1 year ago

Yea, it keeps posting. For example,

  1. I do a commit: b93ca955 => I get a comment.
  2. I do an amend commit 22665eaa and force push with lease => I get a new comment.

Screenshot 2023-05-26 at 15 24 39

lucassabreu commented 1 year ago

i am thinking that it may be related to the custom github token from a real account;

when the action looks for the previous comment it filter for comments from bots;

since the comments on the print do not tag the tag; then it does not find them.

image

i will look into filtering the comments from the same account; not just from a bot.

lucassabreu commented 1 year ago

hi @klippx the new release (v0.10.0) should resolve the problem with using a PAT for the comments.

could you try it and report if it fits your case?

lucassabreu commented 1 year ago

(you may need to delete the older comments yourself first)

klippx commented 1 year ago

It seems to work now! 💅