jackz revised this gist 3 months ago. Go to revision
1 file changed, 75 insertions
forgejo.yml(file created)
| @@ -0,0 +1,75 @@ | |||
| 1 | + | title: | | |
| 2 | + | {{- if and .run.workflow_id (eq .action "success") }} | |
| 3 | + | ✅ Workflow {{ .run.workflow_id }} success in {{ .run.repository.name }} | |
| 4 | + | ||
| 5 | + | {{- else if and .run.workflow_id (eq .action "failure") }} | |
| 6 | + | ❌ Workflow {{ .run.workflow_id }} failed in {{ .run.repository.name }} | |
| 7 | + | ||
| 8 | + | {{- else if and .run.workflow_id (eq .action "recover") }} | |
| 9 | + | ℹ️ Workflow {{ .run.workflow_id }} recovered in {{ .run.repository.name }} | |
| 10 | + | ||
| 11 | + | {{- else if and .run.repository (eq .action "started")}} | |
| 12 | + | 👀 {{ .sender.login }} started watching {{ .run.repository.name }} | |
| 13 | + | ||
| 14 | + | {{- else if and .comment (eq .action "created") }} | |
| 15 | + | 💬 New comment on issue #{{ .issue.number }} {{ .issue.title }} | |
| 16 | + | ||
| 17 | + | {{- else if .pull_request }} | |
| 18 | + | 🔀 Pull request {{ .action }}: #{{ .pull_request.number }} {{ .pull_request.title }} | |
| 19 | + | ||
| 20 | + | {{- else if .issue }} | |
| 21 | + | 🐛 Issue {{ .action }}: #{{ .issue.number }} {{ .issue.title }} | |
| 22 | + | ||
| 23 | + | {{- else }} | |
| 24 | + | {{ fail "Unsupported Forgejo event type or action." }} | |
| 25 | + | {{- end }} | |
| 26 | + | message: | | |
| 27 | + | {{- if and .run.workflow_id (eq .action "success") }} | |
| 28 | + | Triggered by: {{ .run.trigger_event }} | |
| 29 | + | Repository: {{ .run.repository.html_url }} | |
| 30 | + | ||
| 31 | + | {{- else if and .run.workflow_id (eq .action "failure") }} | |
| 32 | + | Triggered by: {{ .run.trigger_event }} | |
| 33 | + | Repository: {{ .run.repository.html_url }} | |
| 34 | + | ||
| 35 | + | {{- else if and .run.workflow_id (eq .action "recover") }} | |
| 36 | + | Triggered by: {{ .run.trigger_event }} | |
| 37 | + | Repository: {{ .run.repository.html_url }} | |
| 38 | + | ||
| 39 | + | {{ else if and .starred_at (eq .action "created")}} | |
| 40 | + | Stargazer: {{ .sender.html_url }} | |
| 41 | + | Repository: {{ .run.repository.html_url }} | |
| 42 | + | ||
| 43 | + | {{- else if and .run.repository (eq .action "started")}} | |
| 44 | + | Watcher: {{ .sender.html_url }} | |
| 45 | + | Repository: {{ .run.repository.html_url }} | |
| 46 | + | ||
| 47 | + | {{- else if and .comment (eq .action "created") }} | |
| 48 | + | Commenter: {{ .comment.user.html_url }} | |
| 49 | + | Repository: {{ .run.repository.html_url }} | |
| 50 | + | Comment link: {{ .comment.html_url }} | |
| 51 | + | {{ if .comment.body }} | |
| 52 | + | Comment: | |
| 53 | + | {{ .comment.body | trunc 2000 }}{{ end }} | |
| 54 | + | ||
| 55 | + | {{- else if .pull_request }} | |
| 56 | + | Branch: {{ .pull_request.head.ref }} → {{ .pull_request.base.ref }} | |
| 57 | + | {{ .action | title }} by: {{ .pull_request.user.html_url }} | |
| 58 | + | Repository: {{ .run.repository.html_url }} | |
| 59 | + | Pull request: {{ .pull_request.html_url }} | |
| 60 | + | {{ if .pull_request.body }} | |
| 61 | + | Description: | |
| 62 | + | {{ .pull_request.body | trunc 2000 }}{{ end }} | |
| 63 | + | ||
| 64 | + | {{- else if .issue }} | |
| 65 | + | {{ .action | title }} by: {{ .issue.user.html_url }} | |
| 66 | + | Repository: {{ .run.repository.html_url }} | |
| 67 | + | Issue link: {{ .issue.html_url }} | |
| 68 | + | {{ if .issue.labels }}Labels: {{ range .issue.labels }}{{ .name }} {{ end }}{{ end }} | |
| 69 | + | {{ if .issue.body }} | |
| 70 | + | Description: | |
| 71 | + | {{ .issue.body | trunc 2000 }}{{ end }} | |
| 72 | + | ||
| 73 | + | {{- else }} | |
| 74 | + | {{ fail "Unsupported Forgejo event type or action." }} | |
| 75 | + | {{- end }} | |
Newer
Older