Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to delete duplicate comments with latest changes (v.1.3.0)? #46

Closed
Jorundur opened this issue Oct 20, 2021 · 2 comments
Closed

How to delete duplicate comments with latest changes (v.1.3.0)? #46

Jorundur opened this issue Oct 20, 2021 · 2 comments

Comments

@Jorundur
Copy link

Jorundur commented Oct 20, 2021

In my action .yml file I've got these lines (changed link to be more generic here):

      - uses: unsplash/comment-on-pr@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          msg: Example link: [see it here](https://some.link/example-${{ github.event.number }}).

Up until now, this has only posted one comment on my PR and then always updated that comment when I pushed more changes to the PR branch. However, after the latest changes it posts a new comment each time I push a new change to the branch.

Obviously, I'm always getting the latest version of comment-on-pr via the - uses: unsplash/comment-on-pr@master when I should perhaps be referring to a specific version... i.e. doing - uses: unsplash/comment-on-pr@v1.2.0 would likely fix this for me, but I'm curious how to fix this while using the latest changes. I couldn't figure that our from reading the code.

It looks like it only deletes the previous (duplicate) comment if I have have a delete_prev_regex_msg argument? https://github.com/unsplash/comment-on-pr/blob/master/entrypoint.sh#L59

What should the regex be if I simply want to match the previous message? I feel like it's a bit odd to have to provide a regex to delete a duplicate.

@Jorundur
Copy link
Author

Nevermind, I think I was misunderstanding things.

It looks like I just have to pass in the check_duplicate_msg as "true" and then the script exits before adding a new comment!

@Jorundur
Copy link
Author

Nevermind that nevermind... it looks like check_duplicate_msg is true by default, so I wonder why this isn't working for me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant