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/:
chant build src -o .forgejo/workflows/ci.ymlConfiguration
Section titled “Configuration”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;Read-only context tools
Section titled “Read-only context tools”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.
Runtime observation
Section titled “Runtime observation”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.
Validating execution
Section titled “Validating execution”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.
Caveats
Section titled “Caveats”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.
At a Glance
Section titled “At a Glance”| Metric | Count |
|---|---|
| Resources | 0 |
| Property types | 0 |
| Services | 0 |
| Intrinsic functions | 0 |
| Pseudo-parameters | 0 |
| Lint rules | 2 |
Lexicon version: 0.38.0
Namespace: Forgejo
- The Forgejo Dialect
- All Rules — 2 rules
- Serialization — output format details