Skip to content

Commit fe509cd

Browse files
authored
integration: add gitea to integrations (#131)
1 parent 29f1ed3 commit fe509cd

File tree

4 files changed

+81
-0
lines changed

4 files changed

+81
-0
lines changed

docs/integrations/gitea/gitea.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Gitea
3+
---
4+
5+
# Gitea
6+
7+
Here's how you can use **Secured Signal API** as a notification service for gitea.
8+
9+
## Setup
10+
11+
### 1. Message Template
12+
13+
Because gitea's webhook data is very _clustered_, we need to use [**Message Templates**](../../configuration/message-template) to ensure correct message rendering.
14+
15+
Here is an example:
16+
17+
```yaml
18+
{{{ #://./message-template.yml }}}
19+
```
20+
21+
Add this to your token config and modify it to your needs.
22+
23+
### 2. Webhook
24+
25+
Head to your gitea repository (or user settings) and go to `Settings > Webhooks` and create a new Gitea webhook.
26+
27+
![Webhook](/integrations/gitea/webhook.png)
28+
29+
## Testing
30+
31+
After you've completed the Setup you can try out your new notification integration:
32+
33+
![Example Issue](/integrations/gitea/issue.png)
34+
35+
```markdown
36+
📝 **#1 Very Important Issue**
37+
🟢 | 👤 User
38+
🔗 https://gitea.domain.com/user/repo/issues/1
39+
```
40+
41+
## Features
42+
43+
The provided Message Template currently supports:
44+
45+
- issues
46+
- commits
47+
- pull requests
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
settings:
2+
message:
3+
template: |
4+
{{- if and @issue (ne @issue nil) (not @is_pull) -}}
5+
📝 **#{{@issue.number}} {{@issue.title}}**
6+
{{ if eq @issue.state "open" -}}🟢{{- else if eq @issue.state "closed" -}}🔴{{- else -}}{{@issue.state}}{{- end }} | 👤 {{@sender.full_name}}
7+
🔗 {{@issue.html_url}}
8+
{{- end -}}
9+
10+
{{- if and @pull_request (ne @pull_request nil) -}}
11+
🚀 **#{{@pull_request.number}} {{@pull_request.title}}**
12+
{{ if eq @pull_request.state "open" -}}🟢{{- else if eq @pull_request.state "closed" -}}🔴{{- else if eq @pull_request.state "merged" -}}🟣{{- else -}}{{@pull_request.state}}{{- end }} | 👤 {{@sender.full_name}}
13+
🔗 {{@pull_request.html_url}}
14+
{{- end -}}
15+
16+
{{- if and @commits (gt (len @commits) 0) }}
17+
📥️ **Push** → *{{@ref}}*
18+
📁 {{@repository.full_name}} | 👤 {{@pusher.full_name}} | 🔢 {{@total_commits}}
19+
{{- range @commits }}
20+
- 🧾 *{{.message}}*
21+
{{- if .added }}
22+
{{- range .added }}➕ {{.}} {{- end }}
23+
{{- end -}}
24+
{{- if .modified }}
25+
{{- range .modified }} ✏️ {{.}} {{- end }}
26+
{{- end -}}
27+
{{- if .removed }}
28+
{{- range .removed }} ❌ {{.}} {{- end }}
29+
{{- end }}
30+
🔗 {{.url}}
31+
{{- end }}
32+
33+
🔎 Compare: {{@compare_url}}
34+
{{- end -}}
126 KB
Loading
119 KB
Loading

0 commit comments

Comments
 (0)