Skip to content

Sync to Azure DevOps #3

Sync to Azure DevOps

Sync to Azure DevOps #3

name: Sync to Azure DevOps
on:
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Git configuration
run: |
git config --global user.name "HotCakeX"
git config --global user.email "[email protected]"
- name: Sync main branch to Azure DevOps
env:
AZURE_REPO_URL: https://[email protected]/SpyNetGirl/Harden-Windows-Security/_git/Harden-Windows-Security
AZURE_DEVOPS_PAT: ${{ secrets.AZUREDEVOPSPATFORSYNC }}
run: |
# Adding Azure DevOps repo as a remote
git remote add azure "$AZURE_REPO_URL"
git remote -v # Verifying the remote was added
# Authenticating with Azure DevOps using PAT
git config --global credential.helper store
echo "https://SpyNetGirl:${AZURE_DEVOPS_PAT}@dev.azure.com" > ~/.git-credentials
# Pushing only the main branch to Azure DevOps
git push azure main --force