gitea-sonarqube-bot/internal/actions/actions.go
justusbunsi 8a7e9f83fa
Refactor action validation
Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
2021-10-17 11:12:50 +02:00

23 lines
315 B
Go

package actions
import "strings"
type BotAction string
const (
ActionReview BotAction = "/sq-bot review"
ActionPrefix string = "/sq-bot"
)
func IsValidBotComment(c string) bool {
if !strings.HasPrefix(c, ActionPrefix) {
return false
}
if c != string(ActionReview) {
return false
}
return true
}