mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-23 00:21:28 +00:00
feat: add gitea/forgejo support
This commit is contained in:
parent
ace036c209
commit
aec0d1a257
43 changed files with 683 additions and 130 deletions
|
|
@ -23,3 +23,14 @@ export function buildMessage(
|
|||
timestamp: partial.timestamp ?? new Date().toISOString(),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Base URL of the forge repo (e.g. `https://github.com/owner/repo` or a Gitea
|
||||
* instance URL). Derived from `repository.html_url` in the payload so it works
|
||||
* for any provider; falls back to github.com for legacy payloads.
|
||||
*/
|
||||
export function repoBaseUrl(payload: Record<string, unknown>, repo?: string): string | undefined {
|
||||
const html = (payload.repository as { html_url?: string } | undefined)?.html_url;
|
||||
if (html) return html;
|
||||
return repo ? `https://github.com/${repo}` : undefined;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue