Skip to content

Bitbucket Pipelines Integration

← Back to CI/CD Overview

Quick Setup

Add Lingo.dev to your Bitbucket pipeline by including this in your bitbucket-pipelines.yml file:

yaml
script:
  - pipe: lingodotdev/lingo.dev:main

Required Environment Variables

Configure this in your repository under Repository settings → Repository variables:

  • LINGODOTDEV_API_KEY - Your Lingo.dev API key

Pull Request Mode Setup

To enable pull request creation instead of direct commits:

  1. Create an access token in Repository settings → Access tokens → Create Repository Access Token
    • Required scopes: read & write repositories, read & write pull requests
  2. Add the token as BB_TOKEN in Repository settings → Repository variables
  3. Enable pull request mode in your pipeline:
yaml
script:
  - pipe: lingodotdev/lingo.dev:main
    variables:
      LINGODOTDEV_PULL_REQUEST: "true"

Complete Pipeline Example

This example automatically translates content when pushing to feature branches:

yaml
image:
  name: atlassian/default-image:2

pipelines:
  branches:
    feat/*:
      - step:
          name: Run i18n
          script:
            - pipe: lingodotdev/lingo.dev:main

How the Integration Works

The Bitbucket integration follows this process:

  1. Runs the translation engine to detect and translate new content
  2. Stages all translation changes
  3. Either commits directly to your branch or creates a pull request
  4. Handles conflicts automatically through rebasing

Configuration Options

VariableDescriptionDefault
LINGODOTDEV_API_KEYYour Lingo.dev API keyRepository variable
LINGODOTDEV_PULL_REQUESTCreate pull request instead of direct pushfalse
LINGODOTDEV_PULL_REQUEST_TITLECustom pull request titlefeat: update translations via @lingodotdev
LINGODOTDEV_COMMIT_MESSAGECustom commit messagefeat: update translations via @lingodotdev
LINGODOTDEV_WORKING_DIRECTORYCustom working directory.
LINGODOTDEV_PROCESS_OWN_COMMITSProcess this action's commitsfalse
BB_TOKENBitbucket access tokenRepository variable

Example with Custom Options

yaml
image:
  name: atlassian/default-image:2

pipelines:
  branches:
    feat/*:
      - step:
          name: Run i18n
          script:
            - pipe: lingodotdev/lingo.dev:main
              variables:
                BB_TOKEN: "${MY_ACCESS_TOKEN}"
                LINGODOTDEV_API_KEY: "${MY_LINGODOTDEV_API_KEY}"
                LINGODOTDEV_PULL_REQUEST: "true"
                LINGODOTDEV_PULL_REQUEST_TITLE: "feat: update translations"
                LINGODOTDEV_COMMIT_MESSAGE: "feat: update translations"
                LINGODOTDEV_WORKING_DIRECTORY: "apps/web"
                LINGODOTDEV_PROCESS_OWN_COMMITS: "true"

Note: The BB_TOKEN variable is required when using pull request mode.