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

Support removing reactions #135

Closed
oxc opened this issue Dec 7, 2022 · 4 comments · Fixed by #161
Closed

Support removing reactions #135

oxc opened this issue Dec 7, 2022 · 4 comments · Fixed by #161

Comments

@oxc
Copy link

oxc commented Dec 7, 2022

I would like to be able to remove reactions from a comment that I previously added.

Consider for example the following use case:
I have a long running job that results in a comment to PR.
When a new change is pushed, I want to indicate that I will update this comment by adding a reaction.
After the new comment content has been posted, I would like to remove this reaction again.

(This can of course as well be handled by adding text and replacing it later. If you want, I can think of a better use case 😂 )

@peter-evans
Copy link
Owner

peter-evans commented Dec 8, 2022

Hi @oxc

I might be able to support this. What I'm thinking could work is to add a new input called reactions-edit-mode, similar to the current edit-mode input. It would default to append, which is what happens now, but it could be changed to replace. When it's set to replace, the action would remove all reactions not in the list of reactions.

I think the challenge with implementing this is going to be fetching the existing reactions and finding those that match the user of the token currently in use. Using the REST API that doesn't look easy because it could be a comment with thousands of reactions and I would need to page through them all. It might be easier to achieve using the GraphQL API, but that would need some investigation.

I'm not going to be able to add this feature in quickly but I'll take a look when I have time. Thank you for suggesting it!

In the meantime, you could attempt to remove reactions yourself by calling the API using github-script.

@oxc
Copy link
Author

oxc commented Dec 8, 2022

Cool, thanks for your elaborate feedback!

An alternative could of course be to just add a remove-reactions property and let the user worry about state tracking (which is probably not required in most cases).

@eseyfert
Copy link

Would love to see this implemented as well. For our use, just replacing all reactions with a new set would be more than enough, no need for tracking who the reactions belong to. Would it be feasible to start with a "dumber" implementation like that first and then make it more sophisticated later on?

Thank you for your efforts!

@peter-evans peter-evans mentioned this issue Apr 4, 2023
Merged
@peter-evans
Copy link
Owner

Released the reactions-edit-mode feature in v3.0.0 / v3.

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

Successfully merging a pull request may close this issue.

3 participants