2019-02-07 00:36:08 -06:00
|
|
|
package parser
|
2019-01-31 01:14:18 -06:00
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2019-02-07 00:36:08 -06:00
|
|
|
// isAllowedEventType returns true if the event type is supported.
|
|
|
|
func isAllowedEventType(eventType string) bool {
|
2019-01-31 01:14:18 -06:00
|
|
|
_, ok := eventTypeWhitelist[strings.ToLower(eventType)]
|
|
|
|
return ok
|
|
|
|
}
|
|
|
|
|
|
|
|
// https://developer.github.com/actions/creating-workflows/workflow-configuration-options/#events-supported-in-workflow-files
|
|
|
|
var eventTypeWhitelist = map[string]struct{}{
|
|
|
|
"check_run": {},
|
|
|
|
"check_suite": {},
|
|
|
|
"commit_comment": {},
|
|
|
|
"create": {},
|
|
|
|
"delete": {},
|
|
|
|
"deployment": {},
|
|
|
|
"deployment_status": {},
|
|
|
|
"fork": {},
|
|
|
|
"gollum": {},
|
|
|
|
"issue_comment": {},
|
|
|
|
"issues": {},
|
|
|
|
"label": {},
|
|
|
|
"member": {},
|
|
|
|
"milestone": {},
|
|
|
|
"page_build": {},
|
|
|
|
"project_card": {},
|
|
|
|
"project_column": {},
|
|
|
|
"project": {},
|
|
|
|
"public": {},
|
|
|
|
"pull_request_review_comment": {},
|
|
|
|
"pull_request_review": {},
|
|
|
|
"pull_request": {},
|
|
|
|
"push": {},
|
|
|
|
"release": {},
|
|
|
|
"repository_dispatch": {},
|
|
|
|
"status": {},
|
|
|
|
"watch": {},
|
|
|
|
}
|