How to Convert Bitbucket Pipelines to GitHub Actions - Step by Step Guide
Input Your Bitbucket Pipelines Configuration
Start with the bitbucket-pipelines.yml file from the root of your repository:
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/**What Gets Converted
The converter reads your Bitbucket Pipelines configuration and writes the closest GitHub Actions setup it can:
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/**Review the Notes
Anything that needs a decision from you is listed in comments at the top of the workflow. The usual ones:
Add the Workflow to Your Repository
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.
Related Tools
Jenkins to GitHub Actions
Convert Jenkins pipelines (Jenkinsfile) to GitHub Actions workflows — stages, parallel stages, when-conditions, post blocks and environment become jobs and steps, and anything it can't convert is listed in notes
GitLab CI to GitHub Actions
Convert GitLab CI/CD pipelines to GitHub Actions workflows with jobs, artifacts, and variables
CI/CD Pipeline Fixer
Fix broken CI/CD pipeline configurations automatically, repair GitHub Actions, GitLab CI, Jenkins, and Azure Pipelines YAML errors
CircleCI to GitHub Actions
Convert CircleCI config.yml to GitHub Actions workflows with jobs, caching, and artifacts
Azure Pipelines to GitHub Actions
Convert Azure Pipelines YAML to GitHub Actions workflows with jobs, tasks, and stages
Travis CI to GitHub Actions
Convert .travis.yml to GitHub Actions workflows with language support, caching, and lifecycle hooks