mirror of
https://github.com/pinpox/gitea-matrix-bot
synced 2024-11-22 10:21:58 +01:00
added blank files for tests
This commit is contained in:
parent
8c50a35e37
commit
cde6cc0266
@ -55,14 +55,14 @@ func PostHandler(w http.ResponseWriter, r *http.Request) {
|
||||
messageText, err := generateTextMessage(postData, r.Header.Get("X-Gitea-Event"))
|
||||
if err != nil {
|
||||
log.Warning(err)
|
||||
log.Warning(postData)
|
||||
log.Warningf("%s", body)
|
||||
}
|
||||
switch msgType {
|
||||
case "html":
|
||||
messageHTML, err := generateHTMLMessage(postData, r.Header.Get("X-Gitea-Event"))
|
||||
if err != nil {
|
||||
log.Warning(err)
|
||||
log.Warning(postData)
|
||||
log.Warningf("%s", body)
|
||||
}
|
||||
mygiteabot.SendHTMLToRoom(room, messageHTML, messageText)
|
||||
case "plain":
|
||||
@ -177,7 +177,7 @@ func generateTextMessage(data GiteaPostData, eventHeader string) (string, error)
|
||||
var tpl bytes.Buffer
|
||||
|
||||
mesgTemplates := map[string]string{
|
||||
"push": "[{{.Repository.Fullname}}] {{.Pusher.FullName}} pushed " + strconv.Itoa(len(data.Commits)) + " commit(s) to {{.Repository.Name}}",
|
||||
"push": "[{{.Repository.Fullname}}]: {{.Pusher.FullName}} pushed " + strconv.Itoa(len(data.Commits)) + " commit(s) to {{.Repository.Name}}",
|
||||
"issues.assigned": "[{{.Repository.FullName}}]: {{.Sender.FullName}} assigned issue #{{.Issue.Number}} {{.Issue.Title}} to {{}}",
|
||||
"issues.closed": "[{{.Repository.FullName}}]: {{.Sender.FullName}} closed issue #{{.Issue.Number}} {{.Issue.Title}}",
|
||||
"issues.demilestoned": "[{{.Repository.FullName}}]: {{.Sender.FullName}} removed milestone TODO from issue #{{.Issue.Number}} {{.Issue.Title}}",
|
||||
|
0
testdata/gitea_postdata/html/fork
vendored
Normal file
0
testdata/gitea_postdata/html/fork
vendored
Normal file
0
testdata/gitea_postdata/html/issue_comment_created
vendored
Normal file
0
testdata/gitea_postdata/html/issue_comment_created
vendored
Normal file
0
testdata/gitea_postdata/html/issue_comment_deleted
vendored
Normal file
0
testdata/gitea_postdata/html/issue_comment_deleted
vendored
Normal file
0
testdata/gitea_postdata/html/issues_assigned
vendored
Normal file
0
testdata/gitea_postdata/html/issues_assigned
vendored
Normal file
0
testdata/gitea_postdata/html/issues_closed
vendored
Normal file
0
testdata/gitea_postdata/html/issues_closed
vendored
Normal file
0
testdata/gitea_postdata/html/issues_demilestoned
vendored
Normal file
0
testdata/gitea_postdata/html/issues_demilestoned
vendored
Normal file
0
testdata/gitea_postdata/html/issues_edited
vendored
Normal file
0
testdata/gitea_postdata/html/issues_edited
vendored
Normal file
0
testdata/gitea_postdata/html/issues_label_cleared
vendored
Normal file
0
testdata/gitea_postdata/html/issues_label_cleared
vendored
Normal file
0
testdata/gitea_postdata/html/issues_label_updated
vendored
Normal file
0
testdata/gitea_postdata/html/issues_label_updated
vendored
Normal file
0
testdata/gitea_postdata/html/issues_milestoned
vendored
Normal file
0
testdata/gitea_postdata/html/issues_milestoned
vendored
Normal file
0
testdata/gitea_postdata/html/issues_opened
vendored
Normal file
0
testdata/gitea_postdata/html/issues_opened
vendored
Normal file
0
testdata/gitea_postdata/html/issues_reopened
vendored
Normal file
0
testdata/gitea_postdata/html/issues_reopened
vendored
Normal file
0
testdata/gitea_postdata/html/issues_synchronized
vendored
Normal file
0
testdata/gitea_postdata/html/issues_synchronized
vendored
Normal file
0
testdata/gitea_postdata/html/issues_unassigned
vendored
Normal file
0
testdata/gitea_postdata/html/issues_unassigned
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_approved
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_approved
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_assigned
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_assigned
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_closed
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_closed
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_comment
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_comment
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_demilestoned
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_demilestoned
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_edited
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_edited
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_label_cleared
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_label_cleared
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_label_updated
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_label_updated
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_milestoned
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_milestoned
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_opened
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_opened
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_rejected
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_rejected
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_reopened
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_reopened
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_synchronized
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_synchronized
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_unassigned
vendored
Normal file
0
testdata/gitea_postdata/html/pull_request_unassigned
vendored
Normal file
0
testdata/gitea_postdata/html/push
vendored
Normal file
0
testdata/gitea_postdata/html/push
vendored
Normal file
0
testdata/gitea_postdata/html/release_deleted
vendored
Normal file
0
testdata/gitea_postdata/html/release_deleted
vendored
Normal file
0
testdata/gitea_postdata/html/release_published
vendored
Normal file
0
testdata/gitea_postdata/html/release_published
vendored
Normal file
0
testdata/gitea_postdata/html/release_updated
vendored
Normal file
0
testdata/gitea_postdata/html/release_updated
vendored
Normal file
0
testdata/gitea_postdata/html/repository_created
vendored
Normal file
0
testdata/gitea_postdata/html/repository_created
vendored
Normal file
0
testdata/gitea_postdata/html/repository_deleted
vendored
Normal file
0
testdata/gitea_postdata/html/repository_deleted
vendored
Normal file
0
testdata/gitea_postdata/text/fork
vendored
Normal file
0
testdata/gitea_postdata/text/fork
vendored
Normal file
0
testdata/gitea_postdata/text/issue_comment_created
vendored
Normal file
0
testdata/gitea_postdata/text/issue_comment_created
vendored
Normal file
0
testdata/gitea_postdata/text/issue_comment_deleted
vendored
Normal file
0
testdata/gitea_postdata/text/issue_comment_deleted
vendored
Normal file
0
testdata/gitea_postdata/text/issues_assigned
vendored
Normal file
0
testdata/gitea_postdata/text/issues_assigned
vendored
Normal file
0
testdata/gitea_postdata/text/issues_closed
vendored
Normal file
0
testdata/gitea_postdata/text/issues_closed
vendored
Normal file
0
testdata/gitea_postdata/text/issues_demilestoned
vendored
Normal file
0
testdata/gitea_postdata/text/issues_demilestoned
vendored
Normal file
0
testdata/gitea_postdata/text/issues_edited
vendored
Normal file
0
testdata/gitea_postdata/text/issues_edited
vendored
Normal file
0
testdata/gitea_postdata/text/issues_label_cleared
vendored
Normal file
0
testdata/gitea_postdata/text/issues_label_cleared
vendored
Normal file
0
testdata/gitea_postdata/text/issues_label_updated
vendored
Normal file
0
testdata/gitea_postdata/text/issues_label_updated
vendored
Normal file
0
testdata/gitea_postdata/text/issues_milestoned
vendored
Normal file
0
testdata/gitea_postdata/text/issues_milestoned
vendored
Normal file
0
testdata/gitea_postdata/text/issues_opened
vendored
Normal file
0
testdata/gitea_postdata/text/issues_opened
vendored
Normal file
0
testdata/gitea_postdata/text/issues_reopened
vendored
Normal file
0
testdata/gitea_postdata/text/issues_reopened
vendored
Normal file
0
testdata/gitea_postdata/text/issues_synchronized
vendored
Normal file
0
testdata/gitea_postdata/text/issues_synchronized
vendored
Normal file
0
testdata/gitea_postdata/text/issues_unassigned
vendored
Normal file
0
testdata/gitea_postdata/text/issues_unassigned
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_approved
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_approved
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_assigned
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_assigned
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_closed
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_closed
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_comment
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_comment
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_demilestoned
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_demilestoned
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_edited
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_edited
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_label_cleared
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_label_cleared
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_label_updated
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_label_updated
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_milestoned
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_milestoned
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_opened
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_opened
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_rejected
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_rejected
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_reopened
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_reopened
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_synchronized
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_synchronized
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_unassigned
vendored
Normal file
0
testdata/gitea_postdata/text/pull_request_unassigned
vendored
Normal file
0
testdata/gitea_postdata/text/push
vendored
Normal file
0
testdata/gitea_postdata/text/push
vendored
Normal file
0
testdata/gitea_postdata/text/release_deleted
vendored
Normal file
0
testdata/gitea_postdata/text/release_deleted
vendored
Normal file
0
testdata/gitea_postdata/text/release_published
vendored
Normal file
0
testdata/gitea_postdata/text/release_published
vendored
Normal file
0
testdata/gitea_postdata/text/release_updated
vendored
Normal file
0
testdata/gitea_postdata/text/release_updated
vendored
Normal file
0
testdata/gitea_postdata/text/repository_created
vendored
Normal file
0
testdata/gitea_postdata/text/repository_created
vendored
Normal file
0
testdata/gitea_postdata/text/repository_deleted
vendored
Normal file
0
testdata/gitea_postdata/text/repository_deleted
vendored
Normal file
Loading…
Reference in New Issue
Block a user