Skip to content

Forgejo

@intentius/chant-lexicon-forgejo targets Forgejo Actions — the CI behind Codeberg, self-hosted Forgejo, and Gitea. Forgejo runs GitHub-Actions-compatible workflows, so the lexicon is a thin dialect of the github lexicon (chant #338): every entity, composite, and expression helper is the same class you’d import from the github package. This package supplies only what is genuinely Forgejo-specific — the serializer dialect and a github → forgejo migration path. One package covers Codeberg, self-hosted Forgejo, and Gitea.

Author exactly as you would for GitHub Actions, importing from the forgejo package; see The Forgejo Dialect for what changes on the way out.

Forgejo reads workflows from .forgejo/workflows/ (or .gitea/workflows/ for Gitea), so point the output there — the same way the github lexicon targets .github/workflows/:

Terminal window
chant build src -o .forgejo/workflows/ci.yml

Override the runner-label map and the actions root in chant.config.ts:

import type { ChantConfig } from "@intentius/chant/config";
// Brings the `forgejo` key into ChantConfig (chant #1344).
import "@intentius/chant-lexicon-forgejo";
export default {
lexicons: ["forgejo"],
forgejo: {
runnerLabels: {
"ubuntu-latest": "docker",
"ubuntu-22.04": "ubuntu-lts",
},
actionsRoot: "https://code.forgejo.org",
},
} satisfies ChantConfig;

The forgejo lexicon ships the full forgejo:* read-only context tools (checks, workflow, references, affected, workflow-yaml, source, owns, compare). Each builds from source and returns what chant already computes — without touching any live forge.

N/A — workflow definitions are git-tracked, so drift is a git diff, the same rationale as the github and gitlab lexicons. The lexicon implements neither describeResources() nor listArtifacts() and is warn-skipped on --live.

A runtime E2E (just forgejo-runtime-e2e) builds a workflow and runs the generated .forgejo/workflows/ci.yml in Docker via a Forgejo runner (forgejo-runner / act_runner / act exec), proving Forgejo Actions accepts and executes chant’s output. On-demand — it needs Docker and a runner tool, and is not part of the gating CI.

Flow-style YAML (branches: [main]) is parsed by chant’s lightweight core parser, which keeps it as a scalar — prefer block style in sources you intend to migrate. This is shared with the github import path.

MetricCount
Resources0
Property types0
Services0
Intrinsic functions0
Pseudo-parameters0
Lint rules2

Lexicon version: 0.38.0
Namespace: Forgejo