Prevent bot from interpreting unknown actions

Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
This commit is contained in:
justusbunsi 2021-10-10 19:45:57 +02:00
parent e28e524456
commit ae55eaf97c
No known key found for this signature in database
GPG key ID: 990B348ECAC9C7DB

View file

@ -59,6 +59,10 @@ func (w *CommentWebhook) Validate() error {
return fmt.Errorf("ignore hook for non-bot action comment")
}
if w.Comment.Body != string(actions.ActionReview) {
return fmt.Errorf("ignore hook for unknown bot action")
}
w.ConfiguredProject = settings.Projects[pIdx]
return nil