/** * Forgejo dialect transform. * * Forgejo Actions (the engine behind Codeberg, self-hosted Forgejo, and Gitea) * runs GitHub-Actions-compatible YAML, so the github lexicon's serializer emits * the right shape. The dialect differs in three small ways, all handled here as * a pre-pass over the resolved entity graph before the github serializer runs: * * 1. `permissions` and `continue-on-error` are silently ignored by the Forgejo * runner — we drop them from the output and warn per occurrence. * 2. GitHub-hosted runner labels (`ubuntu-latest`, …) have no fixed meaning on * Forgejo — we map them to a default Forgejo label, overridable per project. * 3. Anything we can't place (an unmapped runner label) passes through with a * warning rather than being dropped. * * Operating on the entity graph (rather than string-munging YAML) keeps the * transform faithful: the github serializer still does the actual emission. */ import { type Declarable } from "@intentius/chant/declarable"; /** * Default GitHub-hosted runner label → Forgejo label mapping. `docker` is the * label a freshly-registered Forgejo `act_runner` exposes, and the one used * throughout the Forgejo Actions docs, so it is the safest default target. * Override per project via `forgejo.runnerLabels` in `chant.config.ts`. */ export declare const DEFAULT_RUNNER_LABELS: Record; export interface ForgejoDialectOptions { /** Project-supplied label overrides, merged over {@link DEFAULT_RUNNER_LABELS}. */ runnerLabels?: Record; /** Base for resolving mirrored `uses:` action refs (see ./actions). */ actionsRoot?: string; } export interface ForgejoDialectResult { /** The transformed entity map (clones; originals are not mutated). */ entities: Map; /** One warning per dropped key and per unmapped runner label. */ warnings: string[]; } export interface TransformObjectResult { /** The transformed plain value (clone; the input is not mutated). */ value: unknown; /** One warning per dropped key, unmapped label, and unresolved action ref. */ warnings: string[]; } /** * Apply the Forgejo dialect to a plain object — e.g. a parsed GitHub Actions * workflow during migration, rather than the resolved entity graph. Same * rules as {@link applyForgejoDialect}: drop ignored keys, remap runner * labels, resolve `uses:` refs. */ export declare function transformWorkflowObject(obj: unknown, options?: ForgejoDialectOptions): TransformObjectResult; /** * Apply the Forgejo dialect to a resolved entity map. Returns transformed * clones plus the diagnostics produced (dropped keys, unmapped labels). */ export declare function applyForgejoDialect(entities: Map, options?: ForgejoDialectOptions): ForgejoDialectResult; //# sourceMappingURL=dialect.d.ts.map