Loading Bitbucket Pipelines to GitHub Actions Converter...

How to Convert Bitbucket Pipelines to GitHub Actions - Step by Step Guide

Step 1

Input Your Bitbucket Pipelines Configuration

Start with the bitbucket-pipelines.yml file from the root of your repository:

•
Paste directly: Copy the file's contents into the editor on the left.
•
Upload file: Click "Upload" and pick bitbucket-pipelines.yml.
•
Try sample: Click "Sample" to load a small pipeline with a default and a main-branch pipeline.

Example: Bitbucket Pipelines Configuration

A typical Bitbucket Pipelines configuration with one step:

image: node:16

pipelines:
  default:
    - step:
        name: Build and Test
        caches:
          - node
        script:
          - npm install
          - npm test
          - npm run build
        artifacts:
          - dist/**
Step 2

What Gets Converted

The converter reads your Bitbucket Pipelines configuration and writes the closest GitHub Actions setup it can:

•
Steps to jobs: each step becomes a job that needs the step before it; parallel groups share the same earlier job.
•
Pipelines to triggers: default and branch pipelines run on push, tags on tag pushes, pull-requests on pull_request and custom pipelines on workflow_dispatch, each job with an if: check.
•
Images and services: image becomes container, and services from definitions become service containers with their variables.
•
Caches: predefined caches (node, pip, composer, maven, gradle and others) and your own caches become actions/cache steps.
•
Artifacts: a step's artifacts are uploaded and downloaded again in the later jobs of the same pipeline.
•
Deployments: deployment becomes a GitHub environment, and after-script becomes a step that runs with if: always().

Example: Converted GitHub Actions Workflow

The Step 1 file as GitHub Actions YAML:

name: CI
'on':
  push: {}
jobs:
  default_build_and_test:
    name: Build and Test
    runs-on: ubuntu-latest
    if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/')
    container:
      image: node:16
    steps:
      - uses: actions/checkout@v4
      - name: Cache node
        uses: actions/cache@v4
        with:
          path: node_modules
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: ${{ runner.os }}-node-
      - name: Build and Test
        run: |-
          npm install
          npm test
          npm run build
      - name: Upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: default_build_and_test-artifacts
          path: dist/**
Step 3

Review the Notes

Anything that needs a decision from you is listed in comments at the top of the workflow. The usual ones:

•
Secrets: repository and deployment variables are kept in Bitbucket's settings, not in the file. Add them as GitHub secrets or variables.
•
Manual steps: trigger: manual has no direct twin. A GitHub environment with required reviewers pauses the job instead.
•
Pipes: each pipe becomes a placeholder step; pick a Marketplace action for it.
•
Bitbucket variables: $BITBUCKET_BRANCH and friends stay in your scripts until you swap in the GitHub names the notes suggest.
Step 4

Add the Workflow to Your Repository

•
Download workflow: click "Download" to save github-workflow.yml.
•
Add it: put the file in .github/workflows/ at the root of your repository (create the folder if needed).
•
Commit and push: GitHub picks the workflow up on the next push and shows the run on the Actions tab.

Frequently Asked Questions

How does a Bitbucket pipeline map onto GitHub jobs?

Every Bitbucket step becomes its own GitHub job, because both run each step in a fresh container. Steps in a pipeline run one after another, so each job needs the one before it, and a parallel group becomes jobs that all need the same earlier job. The default pipeline, branch pipelines, tag pipelines and pull-requests pipelines share one workflow, and an if: check on each job decides which of them runs for a given push or pull request. Custom pipelines become a workflow_dispatch trigger with a menu for picking one.

What happens to my Bitbucket Pipes?

A pipe has no automatic GitHub equivalent, so it turns into a placeholder step that keeps the pipe's variables as env and echoes a TODO. The notes at the top of the workflow name each pipe. Swap the placeholder for a Marketplace action that does the same job, for example aws-actions/configure-aws-credentials before an S3 upload.

Which parts of my file are not converted?

Manual triggers, changeset conditions, step sizes, the docker cache and service, imported pipelines and any key the converter does not know are left out, and every one of them is listed in a comment block at the top of the output with the pipeline and step it came from. Repository and deployment variables live in Bitbucket's settings rather than in the file, so add them as GitHub secrets or variables yourself. Nothing is dropped without a note.

Will values like long IDs, zip codes or dates change?

No. Script lines are copied character for character, and service variables, pipe variables and custom pipeline defaults keep the exact text you typed, so 8901240544102066246, 00501, 14.50, yes and 2024-01-15 come out unchanged. Values a YAML reader would turn into a number, boolean or date are quoted in the workflow.

Why does my script still mention $BITBUCKET_BRANCH?

Script text is never rewritten, and GitHub does not set Bitbucket's variables. When the converter finds them it suggests the GitHub ones in the notes: $GITHUB_RUN_NUMBER for $BITBUCKET_BUILD_NUMBER, $GITHUB_REF_NAME for $BITBUCKET_BRANCH and $BITBUCKET_TAG, $GITHUB_SHA for $BITBUCKET_COMMIT.

Is my pipeline uploaded anywhere?

No. The conversion runs in your browser and nothing is sent to a server or kept, so a reload starts you off with an empty editor.

Moving from somewhere else? There are converters for Travis CI, CircleCI, GitLab CI, Jenkins and Azure Pipelines too.