forgejo.yml
· 2.7 KiB · YAML
Raw
title: |
{{- if and .run.workflow_id (eq .action "success") }}
✅ Workflow {{ .run.workflow_id }} success in {{ .run.repository.name }}
{{- else if and .run.workflow_id (eq .action "failure") }}
❌ Workflow {{ .run.workflow_id }} failed in {{ .run.repository.name }}
{{- else if and .run.workflow_id (eq .action "recover") }}
ℹ️ Workflow {{ .run.workflow_id }} recovered in {{ .run.repository.name }}
{{- else if and .run.repository (eq .action "started")}}
👀 {{ .sender.login }} started watching {{ .run.repository.name }}
{{- else if and .comment (eq .action "created") }}
💬 New comment on issue #{{ .issue.number }} {{ .issue.title }}
{{- else if .pull_request }}
🔀 Pull request {{ .action }}: #{{ .pull_request.number }} {{ .pull_request.title }}
{{- else if .issue }}
🐛 Issue {{ .action }}: #{{ .issue.number }} {{ .issue.title }}
{{- else }}
{{ fail "Unsupported Forgejo event type or action." }}
{{- end }}
message: |
{{- if and .run.workflow_id (eq .action "success") }}
Triggered by: {{ .run.trigger_event }}
Repository: {{ .run.repository.html_url }}
{{- else if and .run.workflow_id (eq .action "failure") }}
Triggered by: {{ .run.trigger_event }}
Repository: {{ .run.repository.html_url }}
{{- else if and .run.workflow_id (eq .action "recover") }}
Triggered by: {{ .run.trigger_event }}
Repository: {{ .run.repository.html_url }}
{{ else if and .starred_at (eq .action "created")}}
Stargazer: {{ .sender.html_url }}
Repository: {{ .run.repository.html_url }}
{{- else if and .run.repository (eq .action "started")}}
Watcher: {{ .sender.html_url }}
Repository: {{ .run.repository.html_url }}
{{- else if and .comment (eq .action "created") }}
Commenter: {{ .comment.user.html_url }}
Repository: {{ .run.repository.html_url }}
Comment link: {{ .comment.html_url }}
{{ if .comment.body }}
Comment:
{{ .comment.body | trunc 2000 }}{{ end }}
{{- else if .pull_request }}
Branch: {{ .pull_request.head.ref }} → {{ .pull_request.base.ref }}
{{ .action | title }} by: {{ .pull_request.user.html_url }}
Repository: {{ .run.repository.html_url }}
Pull request: {{ .pull_request.html_url }}
{{ if .pull_request.body }}
Description:
{{ .pull_request.body | trunc 2000 }}{{ end }}
{{- else if .issue }}
{{ .action | title }} by: {{ .issue.user.html_url }}
Repository: {{ .run.repository.html_url }}
Issue link: {{ .issue.html_url }}
{{ if .issue.labels }}Labels: {{ range .issue.labels }}{{ .name }} {{ end }}{{ end }}
{{ if .issue.body }}
Description:
{{ .issue.body | trunc 2000 }}{{ end }}
{{- else }}
{{ fail "Unsupported Forgejo event type or action." }}
{{- end }}
| 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 }} |