Skip to content

Factories > Code forges

Connecting other code forges to your factory

Open in ChatGPT ↗
Ask ChatGPT about this page
Open in Claude ↗
Ask Claude about this page
Copied!

Connect a factory to a repository from another code forge using Agent Secrets and setup commands on the default runner.

Connect a factory to a repository on Bitbucket, Azure DevOps, self-managed GitLab, or another code forge without first-class factory support. Create the factory with no connected repository, then clone the repository from its default runner.

  • Permission to configure the factory - Create the factory, add an Agent Secret, and edit its default runner.
  • A repository access token - Create a token that can read the repository. Use a service account where your code forge supports one, and grant only the permissions the factory needs.
  • An authenticated clone command - Use the HTTPS clone syntax your code forge documents. The command must read the token from an environment variable instead of including its value directly.

For provider-specific token and clone formats, see Bitbucket repository access, Azure DevOps repository access, or self-managed GitLab repository access.

Start without a code-host connection so you can prepare the repository from the runner instead.

  1. In the Warp Factories web app, click + next to Factories.
  2. Under Connect your code host, select No repo.
  3. Complete the remaining setup choices to create the factory.

The factory opens in its dashboard without a connected repository.

Store the repository token as an Agent Secret so the default runner can use it without placing the token in a command or definition file.

  1. In the Warp Factories web app, open Secrets and create an Agent Secret named CODE_FORGE_TOKEN.
  2. Add the repository access token as the secret value.
  3. Grant CODE_FORGE_TOKEN to the factory agents that use the default runner.

The secret is available to those agents and their runner setup commands as the CODE_FORGE_TOKEN environment variable.

Clone the repository from the default runner

Section titled “Clone the repository from the default runner”

Runner setup commands prepare each agent workspace before factory work starts.

  1. In the factory dashboard, open Settings > Runners.
  2. Open the default runner and add an authenticated git clone command that reads $CODE_FORGE_TOKEN.
  3. Add any project setup commands the repository needs, such as dependency installation, builds, or code generation.

Use your code forge’s documented clone format. For example, Bitbucket Cloud requires the x-bitbucket-api-token-auth username, while other hosts use a different username or authorization header.

Setup commands run each time the runner prepares a workspace. Make the commands safe to run repeatedly.

Start a direct factory run before you connect another work source.

  1. In the factory dashboard, open Runs and click New.

  2. Send a read-only request such as:

    Test repository access
    In the repository root, list the top-level files and report the current
    branch. Do not change any files.
  3. Confirm that the run reports files from the cloned repository.

If the run cannot clone the repository, confirm that the Agent Secret is granted to the agent, the token has repository read access, and the clone command uses the token environment variable correctly.

This code forge cannot start factory work from its own repository events. Start work from a connected service such as Slack, Linear, or Jira, through a custom webhook, or with a direct factory run.