Back to Initiative Library
CI/CD Migrations Medium complexity

Migrate Bitbucket Pipelines to GitHub Actions

✦ Sample Prompt
Migrate our CI/CD pipeline from Bitbucket Pipelines to GitHub Actions. For each repository:

1. Read bitbucket-pipelines.yml
2. Create equivalent .github/workflows/ci.yml
3. Map Bitbucket concepts to GitHub Actions:
   - pipelines.default → on: push
   - pipelines.branches → on: push: branches:
   - pipelines.pull-requests → on: pull_request
   - pipelines.tags → on: push: tags:
   - step → a job step under steps:
   - caches → actions/cache with equivalent keys
   - artifacts → actions/upload-artifact
   - pipes → equivalent GitHub Actions or inline scripts
4. Preserve deployment environment names and manual trigger patterns
5. Use ubuntu-latest unless the Bitbucket config specifies a Docker image
6. Remove bitbucket-pipelines.yml after migration

Do not change any build commands, test scripts, or deployment scripts.

The Problem

Migrating from Bitbucket Pipelines to GitHub Actions is a common move when organizations consolidate on GitHub as their Git platform. Every repository has a `bitbucket-pipelines.yml` with its own configuration, custom pipeline steps, Bitbucket Pipes (pre-built integrations), deployment environments with manual triggers, and caching definitions.

The syntax differences aren't trivial. Bitbucket uses `step` as a container for commands, GitHub Actions uses `steps` as a list within `jobs`. Bitbucket Pipes need to be mapped to GitHub Actions or inline scripts. Deployment environments in Bitbucket (with manual triggers and approval gates) need to be reconstructed using GitHub's environment protection rules.

When this migration coincides with a platform move (as it often does), the window is tight. Teams need the CI configs converted before the Bitbucket repos are archived.

What Tidra Does

  1. Reads bitbucket-pipelines.yml from each repository, parsing the pipeline definitions, steps, caches, and deployment configurations
  2. Maps Bitbucket's pipeline trigger model (default, branches, pull-requests, tags) to GitHub Actions' on: event syntax
  3. Converts Bitbucket Pipes to equivalent GitHub Actions (e.g., atlassian/aws-s3-deployjakejarvis/s3-sync-action) or inlines the equivalent CLI commands
  4. Generates the GitHub Actions workflow, preserving caching strategies and artifact handling
  5. Creates PRs that include notes on any Bitbucket Pipes that couldn't be automatically mapped

Before & After

diff
bitbucket-pipelines.yml
@@ File removed @@
- image: node:18
-
- pipelines:
- default:
- - step:
- name: Build and Test
- caches:
- - node
- script:
- - npm ci
- - npm test
- - npm run build
- artifacts:
- - dist/**
.github/workflows/ci.yml
@@ New file @@
+ name: CI
+ on:
+ push:
+ branches: [main]
+ pull_request:
+ jobs:
+ build-and-test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: '18'
+ cache: 'npm'
+ - run: npm ci
+ - run: npm test
+ - run: npm run build
+ - uses: actions/upload-artifact@v4
+ with:
+ name: dist
+ path: dist/

Customization Tips

  • Parallel steps: Bitbucket's parallel keyword maps to separate jobs in GitHub Actions running concurrently. Use needs: only when there are actual dependencies.
  • Deployment pipelines: Bitbucket's manual trigger pipelines can be replicated with workflow_dispatch or GitHub's environment protection rules for approval gates.
  • Custom pipes: If your team uses custom Bitbucket Pipes, provide the pipe's source or documentation in the prompt so Tidra can map it accurately.
  • Size limits: Bitbucket has different artifact size limits than GitHub Actions. If your builds produce large artifacts, verify the upload configuration.

Ready to run this across your repos?

Connect your Git provider and Tidra opens pull requests in every repo that needs them.