Skip to content

GitHub to Azure DevOps Sync

Choose a tag to compare

@GuyMicciche GuyMicciche released this 24 Sep 06:06
· 21 commits to main since this release
d6f2250

v1.0.0 – Initial Release: GitHub to Azure DevOps Sync

Features

  • Automatically creates an Azure DevOps project if it does not exist.
  • Automatically creates an Azure DevOps repository if it does not exist.
  • Syncs the entire GitHub repository, including branches and tags, to Azure DevOps.
  • Supports full repository history via --all push.
  • User-friendly: requires only Azure DevOps organization name and PAT.
  • No additional configuration needed; GitHub repository name is used as default project and repo name.

Usage

  1. Add AZURE_DEVOPS_PAT to your repository secrets.
  2. Use the Action in your workflow and provide your DevOps organization name.
  3. The Action will automatically handle project/repo creation and push all branches and tags.

Example .yml

name: Sync to Azure DevOps

on:
  push:
    branches: [ main ]
  workflow_dispatch:

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Sync GitHub repo to Azure DevOps
        uses: GuyMicciche/SyncToAzureDevOps@v1.0.0
        with:
          organization: "dev.azure.com/yourorganization"
          pat: ${{ secrets.AZURE_DEVOPS_PAT }}

Notes

  • Ensure your PAT has the following permissions:
    • Build → Read & execute
    • Code → Read, write, & manage
    • Project and Team → Read, write, & manage
  • Designed for seamless GitHub → Azure DevOps integration in CI/CD workflows.

Complete Step-By-Step Instructions

Follow these steps to create a PAT with the required permissions for the Sync to Azure DevOps GitHub Action.

1. Sign in to Azure DevOps

2. Open User Settings

3. Create a New PAT

  • Under Personal access tokens, click New Token.

4. Fill in Basic Info

  • Name: e.g., GitHub Sync Action
  • Organization: Select your Azure DevOps organization
  • Expiration: Choose a suitable expiration (e.g., 90 days)
  • Scopes: Select Custom defined

5. Set Required Permissions

Area Permissions Access Level
Build Execute Read & execute
Code All Read, write & manage
Project and Team All Read, write & manage

Make sure to check the boxes as shown above.

6. Create the PAT

  • Click Create
  • Copy the token immediately — this is the only time it will be shown.

7. Save the PAT in GitHub

  1. Go to your GitHub repository → Settings → Secrets and variables → Actions → New repository secret
  2. Name it: AZURE_DEVOPS_PAT
  3. Paste the token value
  4. Click Add secret

8. Use the PAT in your Workflow

- name: Sync GitHub repo to Azure DevOps
  uses: GuyMicciche/SyncToAzureDevOps@v1.0.0
  with:
    organization: "dev.azure.com/yourorganization"
    pat: ${{ secrets.AZURE_DEVOPS_PAT }}