Loading GitHub Actions to Azure Pipelines Converter...

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

Step 1

Input Your GitHub Actions Workflow

Start with an existing GitHub Actions workflow, whether you are moving to Azure Pipelines for good or just want to run the same build in Azure DevOps:

•
Paste directly: Copy a workflow from .github/workflows/ into the editor.
•
Upload file: Click "Upload" and pick the .yml file.
•
Try sample: Click "Sample" to load a two-job example workflow.

Example: GitHub Actions Workflow

name: CI Pipeline
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm ci
      - run: npm run build
Step 2

What the Converter Changes

The pipeline appears a moment after you stop typing. Here is how the pieces of a workflow line up with Azure Pipelines YAML:

•
Triggers: push becomes trigger:, pull_request becomes pr:, cron schedules become schedules:, and events with no Azure match are listed. A workflow without a pull_request trigger gets pr: none, because Azure would otherwise build every pull request.
•
Jobs: Job names are turned into names Azure accepts (letters, digits and _), and needs becomes dependsOn.
•
Runners: ubuntu-, windows- and macos- runners become the matching vmImage; self-hosted runners become an agent pool.
•
Actions: checkout, setup-node, setup-python, setup-dotnet, setup-java, setup-go, cache, upload-artifact and download-artifact become Azure tasks. Other actions become placeholder steps.
•
Expressions: Common contexts and if: conditions are rewritten into Azure variables and condition: expressions.

Example: the Same Workflow as azure-pipelines.yml

trigger:
  branches:
    include:
      - '*'
pr:
  branches:
    include:
      - '*'
jobs:
  - job: build
    pool:
      vmImage: ubuntu-latest
    steps:
      - checkout: self
      - task: NodeTool@0
        inputs:
          versionSpec: '20'
      - script: npm ci
      - script: npm run build
Step 3

Review the Notes

When something can't be carried over, the comment block at the top of the pipeline names it. The usual items:

•
Secrets: Create each secret the workflow used as a secret variable or in a variable group.
•
Marketplace actions: Replace the placeholder steps with an Azure task or a script that does the same work.
•
Runner variables: Scripts that read $GITHUB_SHA or write to $GITHUB_OUTPUT need the Azure names, which the notes list.
•
Service connections: Deployments to cloud accounts or private registries need a service connection in Azure DevOps.
Step 4

Create the Pipeline in Azure DevOps

•
Download: Click "Download" to save azure-pipelines.yml.
•
Commit: Put the file in the root of your repository.
•
Create: In Azure DevOps, choose New pipeline, pick your repository and select "Existing Azure Pipelines YAML file".
•
Run: Save and run, then compare the first run with the GitHub one.

Frequently Asked Questions

What does the converter map, and what is left to me?

Push, pull request and schedule triggers become trigger:, pr: and schedules:, workflow_dispatch inputs become runtime parameters, each job keeps its needs as dependsOn, runs-on becomes a Microsoft-hosted vmImage, and a matrix becomes strategy.matrix with every combination spelled out. Checkout, setup-node, setup-python, setup-dotnet, setup-java, setup-go, cache and the artifact actions turn into their Azure tasks. Everything else, such as marketplace actions, environments, job outputs and reusable workflows, is listed in a comment block at the top of the file with the job and step it came from.

How are GitHub secrets handled?

A reference like ${{ secrets.NPM_TOKEN }} becomes $(NPM_TOKEN). Azure never passes secret variables to scripts on its own, so any env entry that reads a secret is mapped into the env: of each step that needs it. You still have to create the secrets in Azure DevOps, either as secret pipeline variables or in a variable group. secrets.GITHUB_TOKEN becomes $(System.AccessToken), which talks to Azure DevOps rather than GitHub.

What happens to ${{ github.sha }} and other expressions?

Azure reads ${{ }} as its own template syntax and would reject GitHub contexts, so common ones are rewritten: github.sha becomes $(Build.SourceVersion), github.ref becomes $(Build.SourceBranch), matrix.node becomes $(node), and if: conditions turn into Azure condition: expressions such as and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')). Expressions it can't translate are left as typed and named in the notes, so you know exactly where to look.

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

No. Script text and env values keep the exact characters you typed, so 8901240544102066246, 00501, 14.50, yes and 2024-01-15 come out unchanged. Values a YAML reader could turn into a number, boolean or date are quoted in the pipeline.

Why do some jobs start with checkout: none?

Azure checks out your repository at the start of every job unless you tell it not to, while GitHub only does it when a step uses actions/checkout. Jobs that never checked out the code on GitHub get checkout: none so they behave the same way.

Can I use self-hosted agents like GitHub self-hosted runners?

Yes. A self-hosted runs-on becomes pool: name: Default, which is the self-hosted pool every Azure DevOps organization starts with. Change the name to your own pool and install the Azure Pipelines agent on the machines you want to use.

Is my workflow uploaded anywhere?

No. The conversion happens in your browser; nothing is sent to a server or kept, and a reload brings back an empty editor.

Going the other way? The Azure Pipelines to GitHub Actions converter does the reverse, and the same workflow can also become a GitLab CI, CircleCI or Travis CI config.