Skip to Content
Skitflow
Git Sources

Forgejo

Connect Forgejo repositories for deployments through an OAuth2 application, set up push webhooks, and use Forgejo with Code Review.

Forgejo is a Gitea-family Git host (Codeberg runs on it). Skitflow connects to it the same way it connects to Gitea: you create an OAuth2 application on your Forgejo instance, give Skitflow its Client ID and Secret, and then use the repositories from that account in Applications or Docker Compose services.

Connect a Forgejo instance

Go to Settings → Git (/dashboard/settings/git-providers), choose Forgejo and fill in the form:

  • Name: any name, for example my-personal-account.
  • Forgejo URL: the address of your instance. The form is pre-filled with https://codeberg.org; replace it for a self-hosted Forgejo.
  • Redirect URI: pre-filled by Skitflow as <your-skitflow-url>/api/providers/forgejo/callback. Copy it into Forgejo.
  • Client ID and Client Secret: the values Forgejo gives you for the OAuth2 application.
  • Skip TLS certificate verification: off by default. Turn it on only for a self-hosted Forgejo that uses a self-signed certificate. The server identity is then not verified for OAuth, API calls or git clones.

Steps:

  1. In Forgejo open Settings → Applications (for example https://codeberg.org/user/settings/applications) and find Create a new OAuth2 Application.
  2. Set the Application Name, for example Skitflow.
  3. Set the Redirect URI to the value shown in Skitflow.
  4. Create the application and copy the Client ID and Client Secret.
  5. Paste them into the Skitflow form and click Configure Forgejo App.
  6. Skitflow saves the provider and redirects you to Forgejo to authorize access. Click Authorize.
  7. You return to the Git section of Skitflow with the provider connected, and its repositories become available in Applications and Docker Compose services.

Forgejo is stored as a Gitea-type provider, so it behaves like Gitea after it is connected. For self-hosted instances, the administrator can restrict which provider URLs Skitflow may reach (GIT_PROVIDER_OUTBOUND_POLICY) and require HTTPS (GIT_PROVIDER_REQUIRE_HTTPS). Both default to permissive values on self-hosted installations.

Setup automatic deployments

The steps are the same for Applications and Docker Compose.

  1. Go to the service and open the Deployments tab.
  2. Copy the Webhook URL.
  3. In Forgejo open the repository, then Settings → Webhooks.
  4. Click Add Webhook and choose the Gitea webhook type.
  5. Set the Target URL to the URL you copied.
  6. In the trigger section, select Push events.
  7. Save the webhook.

Skitflow recognizes a push from the X-Gitea-Event header that the Gitea webhook type sends. Use the Gitea type, not a generic one, so that header is present.

By default Skitflow deploys the branch the service has selected. A push to another branch does not trigger a deployment. To run several environments from one repository, create one service per branch.

Code Review with Forgejo

Forgejo can also be connected to Code Review. That connection is separate from the OAuth provider above and uses an access token instead:

  1. Create a dedicated bot account on Forgejo and an access token for it with repository and organization read/write scopes. Reviews are published from that account.
  2. In Code Review choose Connect Forgejo, enter the Forgejo base URL (pre-filled with https://codeberg.org), the access token, and optionally an organization. With an organization, one organization webhook covers all its repositories. Without it, Skitflow syncs the token's repository memberships and creates a webhook per repository when you enable review.
  3. Skitflow creates the webhook automatically. It accepts both the X-Gitea-* and X-Forgejo-* header sets, because older Forgejo builds send only the Forgejo set.

A plain http:// base URL shows a warning, because the token would be sent unencrypted on every request. A self-hosted installation must enable code_review.enabled and code_review.gitea. See Code Review self-hosted setup.

Differences from Gitea

The two providers share the same connection flow and webhook handling. The differences are small:

  • The add form defaults to https://codeberg.org for Forgejo and https://gitea.com for Gitea.
  • The OAuth callback is /api/providers/forgejo/callback for Forgejo and /api/providers/gitea/callback for Gitea.
  • Code Review labels and defaults follow the chosen product, and Forgejo's own X-Forgejo-* webhook headers are accepted there.

On this page