mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
chore: auto-fix lint & formatting [skip ci]
This commit is contained in:
parent
b14b9f0bde
commit
d6c15a32cd
6 changed files with 64 additions and 63 deletions
|
|
@ -11,7 +11,7 @@ https://your-worker.workers.dev
|
|||
## Endpoints
|
||||
|
||||
| Method | Path | Auth | Description |
|
||||
| -------- | ------------------------------ | ----------------- | ------------------------------------------------------ |
|
||||
| -------- | ------------------------------ | ----------------- | --------------------------------------------------------- |
|
||||
| `GET` | `/health` | None | Health check |
|
||||
| `POST` | `/webhook` | HMAC signature | GitHub webhook ingestion |
|
||||
| `POST` | `/discord/interactions` | Ed25519 signature | Discord interactions (slash commands, buttons, modals) |
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ WebHooker requires several secrets to function. For local development, store the
|
|||
### Optional Secrets
|
||||
|
||||
| Variable | Description | Default |
|
||||
| ------------------------- | ---------------------------------------------------------------------------------------- | --------------------------------- |
|
||||
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
||||
| `DISCORD_PUBLIC_KEY` | Discord application public key (Developer Portal) — required for interactions | Unset → interactions return `401` |
|
||||
| `DISCORD_APPLICATION_ID` | Discord application id; auto-resolved when omitted | Auto-resolved |
|
||||
| `TELEGRAM_WEBHOOK_SECRET` | Secret token for `POST /telegram/webhook` verification (X-Telegram-Bot-Api-Secret-Token) | Disabled (no verification) |
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ https://your-worker.workers.dev
|
|||
## 端点
|
||||
|
||||
| 方法 | 路径 | 鉴权 | 说明 |
|
||||
| -------- | ------------------------------ | ------------ | ------------------------------------- |
|
||||
| -------- | ------------------------------ | ------------ | ------------------------------------------------ |
|
||||
| `GET` | `/health` | 无 | 健康检查 |
|
||||
| `POST` | `/webhook` | HMAC 签名 | GitHub webhook 接入 |
|
||||
| `POST` | `/discord/interactions` | Ed25519 签名 | Discord 交互(斜杠命令、按钮、modal) |
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ WebHooker 需要多个密钥才能运行。本地开发时存储在 `.dev.vars`
|
|||
### 可选密钥
|
||||
|
||||
| 变量 | 说明 | 默认值 |
|
||||
| ------------------------- | -------------------------------------------------------------------- | ----------------------- |
|
||||
| --------------------------- | ------------------------------------------------------------------------------------------------ | ----------------------- |
|
||||
| `BASE_URL` | OAuth 回调的公开 URL | `http://localhost:8787` |
|
||||
| `ADMIN_USER_IDS` | 允许访问 WebUI 的 GitHub 用户 ID(或登录名),逗号分隔 | 未设置时 WebUI 关闭 |
|
||||
| `DISCORD_PUBLIC_KEY` | Discord 应用的公钥(开发者门户获取),交互功能必需 | 未设置时交互返回 401 |
|
||||
|
|
|
|||
|
|
@ -220,10 +220,7 @@ describe("message title spec", () => {
|
|||
description: "Deploy request from octocat",
|
||||
html_url: "https://github.com/acme/widget/deployments/1",
|
||||
};
|
||||
const msg = formatEvent(
|
||||
route,
|
||||
event("deployment", { deployment, repository: repo, sender }),
|
||||
);
|
||||
const msg = formatEvent(route, event("deployment", { deployment, repository: repo, sender }));
|
||||
expect(msg.title).toBe("acme/widget: Deployment to `production` — created");
|
||||
expect(msg.fields![0].value).toBe("🚀 created");
|
||||
expect(msg.fields![1].value).toBe("production");
|
||||
|
|
|
|||
|
|
@ -63,7 +63,11 @@ export function formatDeployment(
|
|||
return buildMessage(
|
||||
{
|
||||
author,
|
||||
title: t("events.deployment.title", { repo: repo ?? t("common.repository"), env, state: "created" }),
|
||||
title: t("events.deployment.title", {
|
||||
repo: repo ?? t("common.repository"),
|
||||
env,
|
||||
state: "created",
|
||||
}),
|
||||
url: deployment.html_url ?? deployment.statuses_url,
|
||||
color: GITHUB_COLORS.deployment_pending,
|
||||
fields,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue