Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion RetestPrototype/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func handleWebhook(w http.ResponseWriter, r *http.Request) {
owner = repo.GetOwner().GetLogin()
number = e.GetIssue().GetNumber()
//log.Println(e.GetNumber())
parseComment(*e.GetComment())
log.Println(parseCommentForRetest(*e.GetComment()))
default:
log.Printf("unknown event type %s\n", github.WebHookType(r))
return
Expand All @@ -71,6 +71,16 @@ func parseComment(com github.IssueComment) {
}
}

// Checks to see if /retest is in the comment and on it's own line
func parseCommentForRetest(com github.IssueComment) bool {
body := com.GetBody()
//log.Println(body)
if strings.Contains(body, "\n/retest\n") {
return true
}
return false
}

// writes Retest Initiated after
func writeComment() {
//getting the github client
Expand Down