mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-20 17:13:49 +00:00
Synchronize both language guides, API references and examples with the implemented authorization, storage and delivery behavior. Document migration requirements and accepted operational limits.
163 lines
5.4 KiB
YAML
163 lines
5.4 KiB
YAML
# Example configuration — the schema of groups and routes, shown as YAML.
|
|
# The worker does not load this file: configuration lives in D1 and is managed
|
|
# from the console (/admin) or the Admin API, which accept the same fields as JSON.
|
|
# Each route defines a filter chain and one or more target destinations
|
|
# (Discord channel/thread, Telegram chat/topic, Feishu chat). See docs/guide/routes.md.
|
|
|
|
# Groups scope admin access and can restrict which org/user events flow in.
|
|
groups:
|
|
- id: default
|
|
name: "Default"
|
|
# Members with roles (owner / admin / viewer); legacy adminIds still work and are treated as owners.
|
|
members:
|
|
- login: "your-github-id"
|
|
role: owner
|
|
# owners: ["myorg"] # restrict events to this org/user (optional)
|
|
# providers: ["github", "gitea", "custom"] # restrict to source platforms (optional; empty = all)
|
|
# installationId: 12345678 # GitHub App installation binding (auto-created on installation.created)
|
|
# emoji: true # include emoji in messages (default true)
|
|
# Forge hosts: label message footers with the host an event came from
|
|
# (optional `name` overrides the host as the display label).
|
|
# forgeSources:
|
|
# - host: "github.com" # GitHub events match github.com
|
|
# type: github
|
|
# name: "GitHub 主站" # optional display label
|
|
# - host: "git1.example.com" # a self-hosted Gitea instance
|
|
# type: gitea
|
|
# - host: "git2.example.com" # another one
|
|
# type: gitea
|
|
# lang: "en" # message language for this group's routes (en/zh or a KV i18n:<lang> override; default en)
|
|
# Webhook log channel: a Discord channel/thread, Telegram chat/topic or Feishu
|
|
# chat that receives a summary of every webhook this group's routes dispatch.
|
|
# logTarget:
|
|
# platform: discord
|
|
# channelId: "CHANNEL_ID_HERE"
|
|
# threadId: "" # optional
|
|
# logTarget:
|
|
# platform: telegram
|
|
# chatId: "-1001234567890"
|
|
# topicId: "" # optional
|
|
|
|
routes:
|
|
- id: all-push
|
|
name: "All Push Events"
|
|
enabled: true
|
|
groupId: default
|
|
filters:
|
|
- type: event
|
|
match: push
|
|
targets:
|
|
- platform: discord
|
|
channelId: "CHANNEL_ID_HERE"
|
|
|
|
# - id: specific-repo
|
|
# name: "Specific Repo"
|
|
# enabled: true
|
|
# groupId: default
|
|
# filters:
|
|
# - type: repo
|
|
# match: "org/repo"
|
|
# - type: event
|
|
# match: [pull_request, issues]
|
|
# targets:
|
|
# - platform: discord
|
|
# channelId: "CHANNEL_ID_HERE"
|
|
# threadId: "THREAD_ID_HERE"
|
|
# - platform: telegram
|
|
# chatId: "-1001234567890" # numeric chat id (no @username)
|
|
# topicId: "42"
|
|
# - platform: feishu
|
|
# chatId: "oc_xxxxxxxxxxxxxxxx" # Feishu group chat_id (no topics)
|
|
|
|
# - id: exclude-bot
|
|
# name: "Exclude Bot Actions"
|
|
# enabled: true
|
|
# groupId: default
|
|
# filters:
|
|
# - type: actor
|
|
# match: "*[bot]"
|
|
# exclude: true
|
|
# targets:
|
|
# - platform: discord
|
|
# channelId: "CHANNEL_ID_HERE"
|
|
|
|
# Discord role mentions: when this route fires, the listed role ids are
|
|
# pinged in every Discord target (Telegram targets ignore this field).
|
|
# - id: mention-on-release
|
|
# name: "Mention Roles on Release"
|
|
# enabled: true
|
|
# groupId: default
|
|
# discordRoleIds: ["111111111111111111", "222222222222222222"]
|
|
# filters:
|
|
# - type: event
|
|
# match: release
|
|
# - type: action
|
|
# match: published
|
|
# targets:
|
|
# - platform: discord
|
|
# channelId: "CHANNEL_ID_HERE"
|
|
|
|
# Fallback routes only fire when no other (non-fallback) route matched.
|
|
# - id: fallback-all
|
|
# name: "Fallback: everything else"
|
|
# enabled: true
|
|
# groupId: default
|
|
# fallback: true
|
|
# filters: []
|
|
# targets:
|
|
# - platform: telegram
|
|
# chatId: "-1001234567890"
|
|
|
|
# Stop routes stop processing further routes of their group when matched.
|
|
# - id: exclusive-push
|
|
# name: "Exclusive Push"
|
|
# enabled: true
|
|
# groupId: default
|
|
# stop: true
|
|
# filters:
|
|
# - type: event
|
|
# match: push
|
|
# targets:
|
|
# - platform: discord
|
|
# channelId: "CHANNEL_ID_HERE"
|
|
|
|
# Field filters match any payload field via a JSONPath (dot-separated) `path`,
|
|
# with an optional `op` operator (eq/ne/contains/startsWith/endsWith/regex/
|
|
# gt/gte/lt/lte/in/exists). Arrays are expanded: any matching element wins.
|
|
# - id: big-pr
|
|
# name: "Large Pull Requests"
|
|
# enabled: true
|
|
# groupId: default
|
|
# filters:
|
|
# - type: event
|
|
# match: pull_request
|
|
# - type: field
|
|
# path: "pull_request.commits"
|
|
# op: gte
|
|
# match: "10"
|
|
# targets:
|
|
# - platform: discord
|
|
# channelId: "CHANNEL_ID_HERE"
|
|
|
|
# Nested `ast` groups (all / any / not) take precedence over the flat `filters`
|
|
# list; the route still carries a `filters` list (it may be empty).
|
|
# - id: grouped-owners
|
|
# name: "PRs from either owner"
|
|
# enabled: true
|
|
# groupId: default
|
|
# filters: []
|
|
# ast:
|
|
# all:
|
|
# - type: event
|
|
# match: pull_request
|
|
# - any:
|
|
# - type: field
|
|
# path: "pull_request.user.login"
|
|
# match: alice
|
|
# - type: field
|
|
# path: "pull_request.user.login"
|
|
# match: bob
|
|
# targets:
|
|
# - platform: discord
|
|
# channelId: "CHANNEL_ID_HERE"
|