From 8b03e13247209d7b97a71cd490a79255feb918c1 Mon Sep 17 00:00:00 2001 From: Shawn Yuan Date: Thu, 12 Feb 2026 14:29:42 +0800 Subject: [PATCH] update --- .pipelines/UpdateVersions.ps1 | 8 ++++++++ .pipelines/v2/ci-using-the-latest-winappsdk.yml | 5 +++++ .../steps-update-winappsdk-and-restore-nuget.yml | 2 ++ 3 files changed, 15 insertions(+) diff --git a/.pipelines/UpdateVersions.ps1 b/.pipelines/UpdateVersions.ps1 index b557670e78..2a09fc57ab 100644 --- a/.pipelines/UpdateVersions.ps1 +++ b/.pipelines/UpdateVersions.ps1 @@ -151,6 +151,14 @@ function Download-ArtifactFromPipeline { New-Item -ItemType Directory -Path $OutputDir -Force | Out-Null try { + # Authenticate with Azure DevOps using System Access Token (if available) + if ($env:SYSTEM_ACCESSTOKEN) { + Write-Host "Authenticating with Azure DevOps using System Access Token..." + $env:AZURE_DEVOPS_EXT_PAT = $env:SYSTEM_ACCESSTOKEN + } else { + Write-Host "No SYSTEM_ACCESSTOKEN found, assuming az CLI is already authenticated..." + } + # Use az CLI to download artifact $azArgs = "pipelines runs artifact download --organization $Organization --project $Project --run-id $BuildId --artifact-name `"$ArtifactName`" --path `"$OutputDir`"" Invoke-Expression "az $azArgs" diff --git a/.pipelines/v2/ci-using-the-latest-winappsdk.yml b/.pipelines/v2/ci-using-the-latest-winappsdk.yml index a78c4a0305..0c5da3a6f6 100644 --- a/.pipelines/v2/ci-using-the-latest-winappsdk.yml +++ b/.pipelines/v2/ci-using-the-latest-winappsdk.yml @@ -1,3 +1,8 @@ +# NOTE: When using artifact mode (useArtifactSource: true), the pipeline needs +# permission to access System.AccessToken. This is automatically handled by the +# script if SYSTEM_ACCESSTOKEN environment variable is available. +# If you encounter authentication errors, ensure the job has oauth access enabled. + trigger: none pr: none schedules: diff --git a/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml b/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml index 3b42520fef..ea50dc9734 100644 --- a/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml +++ b/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml @@ -31,6 +31,8 @@ steps: - task: PowerShell@2 displayName: Update WinAppSDK Versions + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) inputs: filePath: '$(build.sourcesdirectory)\.pipelines\UpdateVersions.ps1' arguments: >