How to Migrate From Azure Pipelines to GitHub Actions
Azure stages and jobs map to Actions jobs with needs, the pool becomes runs-on, tasks become actions, and variable groups become secrets.
Azure Pipelines stages and jobs map to Actions jobs. Replace pool with runs-on, each task: with an equivalent action or run:, and variables/variable groups with secrets and env.
Concept mapping
| Azure Pipelines | GitHub Actions |
|---|---|
stages / jobs | jobs: with needs: |
pool: vmImage | runs-on: |
- task: X@n | a marketplace action or run: |
- script: | run: |
variable group / variables | secrets and env: |
dependsOn | needs: |
Before
azure-pipelines.yml
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '20.x'
- script: npm ci
- script: npm testAfter
.github/workflows/ci.yml
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm testWhat does not map cleanly
- Azure task inputs rarely match an action one-to-one; check each action README for the equivalent input.
- Azure
condition:expressions use a different syntax than Actionsif:and must be rewritten. - Azure service connections become secrets plus a login action (for example cloud OIDC login).
Related guides
How to Migrate From Bitbucket Pipelines to GitHub ActionsConvert a bitbucket-pipelines.yml to GitHub Actions, mapping pipelines and steps to jobs, image to container,…
How to Migrate Secrets to GitHub ActionsMove CI secrets from Travis, GitLab, CircleCI, or Jenkins into GitHub Actions repository, environment, and or…