Support triggering workflows by wiki related events (#24119)

This PR is to support triggering workflows by wiki related events like
creating, editing or deleting wiki pages. In GitHub, this event is
called
[gollum](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#gollum)
This commit is contained in:
Zettat123 2023-04-18 01:49:47 +08:00 committed by GitHub
parent 4014200021
commit 5eb4c63867
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 2 deletions

View file

@ -21,6 +21,7 @@ const (
githubEventIssueComment = "issue_comment"
githubEventRelease = "release"
githubEventPullRequestComment = "pull_request_comment"
githubEventGollum = "gollum"
)
// canGithubEventMatch check if the input Github event can match any Gitea event.
@ -29,6 +30,10 @@ func canGithubEventMatch(eventName string, triggedEvent webhook_module.HookEvent
case githubEventRegistryPackage:
return triggedEvent == webhook_module.HookEventPackage
// See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#gollum
case githubEventGollum:
return triggedEvent == webhook_module.HookEventWiki
case githubEventIssues:
switch triggedEvent {
case webhook_module.HookEventIssues,