-
Notifications
You must be signed in to change notification settings - Fork 88
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
On delete
mode new comment always will be created
#361
Comments
create_if_not_exists
is ignored on delete
modecreate_if_not_exists
is delete
mode
create_if_not_exists
is delete
modedelete
mode new comment always wil be created
Noticed same behavior as well .. |
delete
mode new comment always wil be createddelete
mode new comment always will be created
I think we are having the same (or similar) problem. I'd like to just be able to delete comments that have the specified - name: Delete comment if exists
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: 'some_tag'
mode: delete Currently we get an error because either
To me, the current +++ b/src/main.ts
@@ -157,6 +157,12 @@ async function run() {
body,
});
return;
+ } else if (mode === 'only-delete') {
+ await deleteComment({
+ ...context.repo,
+ comment_id: comment.id,
+ });
+ return;
} else if (mode === 'delete') {
core.debug('Registering this comment to be deleted.'); |
Here's a proof of concept with no backwards compatibility issues: iFixit/actions-comment-pull-request@main...iFixit:actions-comment-pull-request:add-only-delete I can open a PR if you'd like. |
Released in |
Hello,
i have the situation when i change
mode
dynamically based on the result of another step, but ondelete
mode extra comment will be temporarily added all the time due to current logic.I use this Action to add comment on PR in case if TFLinter finds some concerns based on exit code.
When TFLinter finds concern, the Action adds comment as it runs based on
so, if there is any concerns it will be
pr_comment_mode=recreate
means comment will be added. Everything as expected.When there is a new commit with changes, but still some concerns from TFLinter, comment will be recreated and Action works as expected.
But if all the TFLint concerns were fixed, then mentioned step sets
pr_comment_mode=delete
.In this situation there is a small side effect as
delete
mode always creates comment. The thing is, there is a situation when it will be two PR comments from this Action, one created when it was TFLint concerns and the new extra short living comment ascreateComment
function will be executed before post step which will remove both comments later.It will be great if it can be avoided the creation of new intermediate PR comment when
mode: delete
in the situation I've described.Maybe, it is kind of "new" mode (
cleanup
?) whendelete
works just as delete, without creation of any comment before the deletion in the end during post step.The text was updated successfully, but these errors were encountered: