Skip to content

Forgejo

Fully supported — release PRs, changelog, tagging-on-merge, and brel init all work on Forgejo (including Codeberg and self-hosted instances). brel talks to Forgejo through its REST API.

  • git available wherever brel runs.
  • A Forgejo access token with repository write access. brel reads it from BREL_FORGEJO_TOKEN, then FORGEJO_TOKEN, then GITHUB_TOKEN (Forgejo Actions exposes GitHub-compatible variable names, so the automatic workflow token works out of the box).
  • A Forgejo Actions runner with Docker available (the generated workflow uses runs-on: docker with a rust:latest container).
  1. Install brel and create a brel.toml at the repository root:

    provider = "forgejo"
    default_branch = "main"
    [release_pr.version_updates]
    "package.json" = ["version"]
  2. Generate the managed workflow:

    Terminal window
    brel validate
    brel init --yes

    This writes the Forgejo Actions workflow (default name release-pr.yml, marked # managed-by: brel).

  3. Commit and push to main. Every push to main now runs brel release-pr and keeps a release PR up to date.

  • Triggers on pushes to your default branch and on workflow_dispatch.
  • Runs in a rust:latest container, checking out with full history via https://code.forgejo.org/actions/checkout@v4.
  • Installs a pinned brel with cargo install brel --version <version> --locked, plus the changelog runtime (git-cliff via cargo, or Node via setup-node for changelogen).
  • Runs brel changelog then brel release-pr with BREL_FORGEJO_TOKEN set from the workflow token.

brel discovers the instance and repository from FORGEJO_SERVER_URL/FORGEJO_REPOSITORY (or their GITHUB_* aliases), which Forgejo Actions provides automatically.

With [release_pr.tagging] enabled, the workflow gains a pull_request: closed trigger and a release-tag job that runs brel tag when a managed release PR merges. Event data comes from FORGEJO_EVENT_PATH (or GITHUB_EVENT_PATH).

Terminal window
BREL_FORGEJO_TOKEN=... \
FORGEJO_SERVER_URL=https://codeberg.org \
FORGEJO_REPOSITORY=owner/repo \
brel release-pr

See Environment Variables for the full list.