Bitbucket Pipelines Integration
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:
- Create an access token in Repository settings → Access tokens → Create Repository Access Token
- Required scopes: read & write repositories, read & write pull requests
- Add the token as
BB_TOKEN
in Repository settings → Repository variables - 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:
- Runs the translation engine to detect and translate new content
- Stages all translation changes
- Either commits directly to your branch or creates a pull request
- Handles conflicts automatically through rebasing
Configuration Options
Variable | Description | Default |
---|---|---|
LINGODOTDEV_API_KEY | Your Lingo.dev API key | Repository variable |
LINGODOTDEV_PULL_REQUEST | Create pull request instead of direct push | false |
LINGODOTDEV_PULL_REQUEST_TITLE | Custom pull request title | feat: update translations via @lingodotdev |
LINGODOTDEV_COMMIT_MESSAGE | Custom commit message | feat: update translations via @lingodotdev |
LINGODOTDEV_WORKING_DIRECTORY | Custom working directory | . |
LINGODOTDEV_PROCESS_OWN_COMMITS | Process this action's commits | false |
BB_TOKEN | Bitbucket access token | Repository 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.