Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions docs/integrations/gitea/gitea.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Gitea
---

# Gitea

Here's how you can use **Secured Signal API** as a notification service for gitea.

## Setup

### 1. Message Template

Because gitea's webhook data is very _clustered_, we need to use [**Message Templates**](../../configuration/message-template) to ensure correct message rendering.

Here is an example:

```yaml
{{{ #://./message-template.yml }}}
```

Add this to your token config and modify it to your needs.

### 2. Webhook

Head to your gitea repository (or user settings) and go to `Settings > Webhooks` and create a new Gitea webhook.

![Webhook](/integrations/gitea/webhook.png)

## Testing

After you've completed the Setup you can try out your new notification integration:

![Example Issue](/integrations/gitea/issue.png)

```markdown
📝 **#1 Very Important Issue**
🟢 | 👤 User
🔗 https://gitea.domain.com/user/repo/issues/1
```

## Features

The provided Message Template currently supports:

- issues
- commits
- pull requests
34 changes: 34 additions & 0 deletions docs/integrations/gitea/message-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
settings:
message:
template: |
{{- if and @issue (ne @issue nil) (not @is_pull) -}}
📝 **#{{@issue.number}} {{@issue.title}}**
{{ if eq @issue.state "open" -}}🟢{{- else if eq @issue.state "closed" -}}🔴{{- else -}}{{@issue.state}}{{- end }} | 👤 {{@sender.full_name}}
🔗 {{@issue.html_url}}
{{- end -}}

{{- if and @pull_request (ne @pull_request nil) -}}
🚀 **#{{@pull_request.number}} {{@pull_request.title}}**
{{ 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}}
🔗 {{@pull_request.html_url}}
{{- end -}}

{{- if and @commits (gt (len @commits) 0) }}
📥️ **Push** → *{{@ref}}*
📁 {{@repository.full_name}} | 👤 {{@pusher.full_name}} | 🔢 {{@total_commits}}
{{- range @commits }}
- 🧾 *{{.message}}*
{{- if .added }}
{{- range .added }}➕ {{.}} {{- end }}
{{- end -}}
{{- if .modified }}
{{- range .modified }} ✏️ {{.}} {{- end }}
{{- end -}}
{{- if .removed }}
{{- range .removed }} ❌ {{.}} {{- end }}
{{- end }}
🔗 {{.url}}
{{- end }}

🔎 Compare: {{@compare_url}}
{{- end -}}
Binary file added static/integrations/gitea/issue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/integrations/gitea/webhook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.