| 98 | } |
| 99 | |
| 100 | func createPushText(event *types.PushEvent) string { |
| 101 | text := fmt.Sprintf("<b>🔨 %d New commit to</b> <a href='%s'>%s</a>[<code>%s</code>]\n\n", |
| 102 | len(event.Commits), |
| 103 | event.Repo.HTMLURL, |
| 104 | event.Repo.FullName, |
| 105 | strings.Replace(event.Ref, "refs/heads/", "", 1), |
| 106 | ) |
| 107 | |
| 108 | for _, commit := range event.Commits { |
| 109 | text += fmt.Sprintf("• <a href='%s'>%s</a> - %s by <a href='%s'>%s</a>\n", |
| 110 | commit.Url, |
| 111 | commit.Id[:7], |
| 112 | html.EscapeString(commit.Message), |
| 113 | commit.Author.HTMLURL, |
| 114 | commit.Author.Name, |
| 115 | ) |
| 116 | } |
| 117 | |
| 118 | return text |
| 119 | } |
| 120 | |
| 121 | func createForkText(event *types.ForkEvent) string { |
| 122 | return fmt.Sprintf("🍴 <a href='%s'>%s</a> forked <a href='%s'>%s</a> → <a href='%s'>%s</a>", |