chore: auto-fix lint & formatting [skip ci]

This commit is contained in:
github-actions[bot] 2026-08-14 00:51:23 +00:00
parent 3f6f7f17b5
commit c58b800987
6 changed files with 112 additions and 77 deletions

View file

@ -169,10 +169,7 @@ export function senderProfileUrl(repoUrl: string | undefined, login: string): st
* entry's display `name` (or its host when no name is set). Link/favicon are
* derived from the repository URL.
*/
export function forgeInfo(
event: WebhookEvent,
sources?: ForgeSource[],
): NeutralForge | undefined {
export function forgeInfo(event: WebhookEvent, sources?: ForgeSource[]): NeutralForge | undefined {
const repoUrl = (event.payload.repository as { html_url?: string } | undefined)?.html_url;
let host: string | undefined;
if (repoUrl) {
@ -186,9 +183,7 @@ export function forgeInfo(
if (!host && event.provider === "github") host = "github.com";
if (!host) return undefined;
const source = sources?.find(
(s) => s.type === event.provider && s.host.toLowerCase() === host,
);
const source = sources?.find((s) => s.type === event.provider && s.host.toLowerCase() === host);
if (!source) return undefined;
const label = source.name?.trim() || source.host;

View file

@ -36,7 +36,8 @@ import { log } from "../lib/log";
const VALID_FILTER_TYPES = new Set(["event", "repo", "actor", "action", "branch", "keyword"]);
const ID_RE = /^[a-z0-9][a-z0-9-]*$/;
const HOST_RE = /^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*$/;
const HOST_RE =
/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*$/;
function isValidMatch(match: unknown): match is string | string[] {
if (typeof match === "string") return match.trim().length > 0;
@ -328,10 +329,7 @@ export function validateGroups(
error: `group "${g.id}".forgeSources[${i}].type must be "github" | "gitea"`,
};
}
if (
s.name !== undefined &&
(typeof s.name !== "string" || s.name.length > 50)
) {
if (s.name !== undefined && (typeof s.name !== "string" || s.name.length > 50)) {
return {
ok: false,
error: `group "${g.id}".forgeSources[${i}].name must be a string`,