Skip to content

Commit

Permalink
Update AzureDevOps.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelhorak authored Jan 5, 2025
1 parent af4080f commit d8aa584
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/AzureDevOps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:
- created
- edited

concurrency:
group: issue-${{ github.event.issue.number }}
cancel-in-progress: false
#concurrency:
# group: issue-${{ github.event.issue.number }}
# cancel-in-progress: false

permissions:
id-token: write
issues: write
contents: read
#permissions:
# id-token: write
# issues: write
# contents: read

jobs:
updateAzDO:
Expand All @@ -26,29 +26,30 @@ jobs:

steps:
# Step 1: Login to Azure using federated identity
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.ENTRA_APP_CLIENT_ID }}
tenant-id: ${{ secrets.ENTRA_APP_TENANT_ID }}
subscription-id: ${{ secrets.ADO_SUBSCRIPTION_ID }}
# - name: Login to Azure
# uses: azure/login@v2
# with:
# client-id: ${{ secrets.ENTRA_APP_CLIENT_ID }}
# tenant-id: ${{ secrets.ENTRA_APP_TENANT_ID }}
# subscription-id: ${{ secrets.ADO_SUBSCRIPTION_ID }}
# environment: azurecloud
# allow-no-subscriptions: true
# enable-debug-logs: true

# Step 2: Obtain Azure DevOps token
- name: Get Azure DevOps token
id: get_ado_token
run: |
# - name: Get Azure DevOps token
# id: get_ado_token
# run: |
# Fetch Azure DevOps token using resource ID 499b84ac-1321-427f-aa17-267ca6975798
ado_token=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv)
echo "ado_token=${ado_token}" >> $GITHUB_ENV
# ado_token=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv)
# echo "ado_token=${ado_token}" >> $GITHUB_ENV

# Step 3: Sync GitHub issue to Azure DevOps work item
- name: Sync issue to Azure DevOps
uses: pavelhorak/github-actions-issue-to-work-item@main
env:
ado_token: "${{ env.ado_token }}"
# ado_token: "${{ env.ado_token }}"
ado_token: "${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}"
github_token: "${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}"
ado_organization: "${{ secrets.ADO_ORGANIZATION }}"
ado_project: "${{ secrets.ADO_PROJECT }}"
Expand Down

0 comments on commit d8aa584

Please sign in to comment.