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

feat: add update-condition for github-comment exec #1722

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ponkio-o
Copy link
Contributor

@ponkio-o ponkio-o commented Jan 3, 2025

Check List

I have added --update-conditon to exec sub-command so that existing comments can be overwritten. post implementation as a reference (PR: #473)

related:

@ponkio-o
Copy link
Contributor Author

ponkio-o commented Jan 3, 2025

🤔

Error: pkg/api/exec.go:217:1: calculated cyclomatic complexity for function getComment is 11, max is 10 (cyclop)
func (c *ExecController) getComment(execConfigs []*config.ExecConfig, cmtParams *ExecCommentParams, templates map[string]string) (*github.Comment, bool, error) { //nolint:funlen

@@ -345,3 +355,75 @@ func (c *ExecController) handleOutput(ctx context.Context, cmt *github.Comment,
}
return nil
}

func (c *ExecController) setUpdatedCommentID(ctx context.Context, cmt *github.Comment, updateCondition string) error { //nolint:funlen
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is almost identical to post command, so I think refactoring it other PR.

@ponkio-o
Copy link
Contributor Author

ponkio-o commented Jan 9, 2025

@suzuki-shunsuke What do you think? We are using github-comment exec heavily in many repositories on work, so I want to use this feature.

@suzuki-shunsuke
Copy link
Owner

Sorry, I'll take a look this weekend.
Honestly, I'm not a fan of updating comments, but I understand that this feature is necessary for some users like you.

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 this pull request may close these issues.

2 participants