-
Notifications
You must be signed in to change notification settings - Fork 13
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
add new hook to add new template in comment #50
Conversation
"github.com/pkg/errors" | ||
"io/ioutil" | ||
"regexp" | ||
"strings" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
group this import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it
pkg/providers/add-template/event.go
Outdated
issueID := event.GetIssue().GetNumber() | ||
temMatches := templatePattern.FindStringSubmatch(comment) | ||
if strings.TrimSpace(temMatches[0]) == "/info" { | ||
return errors.Wrap(c.addTemplate(issueID), "label issue") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here will always return error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, my mistake, will fix it
templatePattern = regexp.MustCompile(`\/info`) | ||
) | ||
|
||
func (c *Comment) ProcessIssueCommentEvent(event *github.IssueCommentEvent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this function will be called
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bot/webhook.go
may need to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I will add this process in bot entrance function
IMO the |
OK, I will try to fix this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@you06 @AndreMouche PTAL
我看了一下,我直接把这个文件从repo里删除,然后放到和生成的 bot 文件同一个目录就行吧。我直接删除吧。 |
Mostly LGTM, can you remove some unnecessary comments from code? |
Thanks for this PR! |
What problem does this PR solve?
Problem Summary:
What is changed and how it works?
What's Changed: add a new hook to give template in the comment when user input /info
How it Works: in the comment input box, input '/info'
Release note
No release note