From a3b9a3c9294ecee17251b37299e45b55ed564701 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 9 Nov 2026 05:04:27 +0000 Subject: [PATCH 1/7] Backflow from https://github.com/dotnet/dotnet / 295ff61 build 339997 Diff: https://github.com/dotnet/dotnet/compare/a329f1ca54daf957358604bcdbb49ccab64450a0..295ff616832ba1f8b192f8178c4188a133affe93 From: https://github.com/dotnet/dotnet/commit/a329f1ca54daf957358604bcdbb49ccab64450a0 To: https://github.com/dotnet/dotnet/commit/295ff616832ba1f8b192f8178c4188a133affe93 [[ commit created by automation ]] --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 7d777b5c16..d50eb62726 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -3,7 +3,7 @@ - 2.2.14 + 2.2.15 servicing From 8cc192b4ce263eba7536c63ad5afdcee00c6b83e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 9 Nov 2026 05:04:28 +0000 Subject: [PATCH 2/7] Update dependencies from build 339997 Updated Dependencies: Microsoft.DotNet.Arcade.Sdk (Version 10.0.0-beta.26513.124 -> 10.0.0-beta.26554.114) [[ commit created by automation ]] --- eng/Version.Details.props | 2 +- eng/Version.Details.xml | 6 +++--- eng/common/core-templates/job/onelocbuild.yml | 2 +- eng/common/tools.ps1 | 2 +- global.json | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 9408c11d1b..0c51c5574c 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,7 +6,7 @@ This file should be imported by eng/Versions.props - 10.0.0-beta.26513.124 + 10.0.0-beta.26554.114 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b91d4619b3..6ce3dcf7e3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,12 +1,12 @@ - + - + https://github.com/dotnet/dotnet - d7437ff14b570b50cce30b01edbf568a3d1ff933 + 295ff616832ba1f8b192f8178c4188a133affe93 diff --git a/eng/common/core-templates/job/onelocbuild.yml b/eng/common/core-templates/job/onelocbuild.yml index adcdfa1753..5e398434ec 100644 --- a/eng/common/core-templates/job/onelocbuild.yml +++ b/eng/common/core-templates/job/onelocbuild.yml @@ -107,7 +107,7 @@ jobs: outputVariableName: 'GitHubAppInstallationToken' condition: ${{ parameters.condition }} - - task: OneLocBuild@2 + - task: OneLocBuild@3 displayName: OneLocBuild env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index bde220ad85..295f26c351 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -517,7 +517,7 @@ function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) { }) if (!(Test-Path $packagePath)) { - Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "See https://dev.azure.com/dnceng/internal/_wiki/wikis/DNCEng%20Services%20Wiki/1074/Updating-Microsoft.DotNet.Arcade.MSBuild.Xcopy-WAS-RoslynTools.MSBuild-(xcopy-msbuild)-generation?anchor=troubleshooting for help troubleshooting issues with XCopy MSBuild" + Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "See https://dev.azure.com/dnceng/internal/_wiki/wikis/DNCEng%20Services%20Wiki/1857/Operations/FR/Updating-Microsoft.DotNet.Arcade.MSBuild.Xcopy-WAS-RoslynTools.MSBuild-(xcopy-msbuild)-generation?anchor=troubleshooting for help troubleshooting issues with XCopy MSBuild" throw } Unzip $packagePath $packageDir diff --git a/global.json b/global.json index e1b8bd9986..565c9e2103 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.112", + "version": "10.0.114", "allowPrerelease": true, "rollForward": "latestFeature", "paths": [ @@ -10,9 +10,9 @@ "errorMessage": "The required .NET SDK wasn't found. Please run ./eng/common/dotnet.cmd/sh to install it." }, "tools": { - "dotnet": "10.0.112" + "dotnet": "10.0.114" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26513.124" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26554.114" } } From e661576f1b4b5261bb59d9e0d718f56e40078fa8 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 16 Nov 2026 05:03:58 +0000 Subject: [PATCH 3/7] Backflow from https://github.com/dotnet/dotnet / e43baa6 build 341447 Diff: https://github.com/dotnet/dotnet/compare/295ff616832ba1f8b192f8178c4188a133affe93..e43baa62049eb55227dc78c1e7403793a2ffa7cb From: https://github.com/dotnet/dotnet/commit/295ff616832ba1f8b192f8178c4188a133affe93 To: https://github.com/dotnet/dotnet/commit/e43baa62049eb55227dc78c1e7403793a2ffa7cb [[ commit created by automation ]] --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index d50eb62726..8be9cfe2e4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -3,7 +3,7 @@ - 2.2.15 + 2.2.16 servicing From 8fc7de8c1aab4a717ed8194c97a1d650b4b432c6 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 16 Nov 2026 05:03:59 +0000 Subject: [PATCH 4/7] Update dependencies from build 341447 Updated Dependencies: Microsoft.DotNet.Arcade.Sdk (Version 10.0.0-beta.26554.114 -> 10.0.0-beta.26563.110) [[ commit created by automation ]] --- eng/Version.Details.props | 2 +- eng/Version.Details.xml | 6 +++--- eng/common/core-templates/job/publish-build-assets.yml | 4 ++-- eng/common/core-templates/post-build/post-build.yml | 4 ++-- eng/common/tools.ps1 | 3 ++- eng/common/tools.sh | 3 ++- global.json | 6 +++--- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 0c51c5574c..2112bdc27f 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,7 +6,7 @@ This file should be imported by eng/Versions.props - 10.0.0-beta.26554.114 + 10.0.0-beta.26563.110 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6ce3dcf7e3..693bebeaed 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,12 +1,12 @@ - + - + https://github.com/dotnet/dotnet - 295ff616832ba1f8b192f8178c4188a133affe93 + e43baa62049eb55227dc78c1e7403793a2ffa7cb diff --git a/eng/common/core-templates/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml index 718b7f0a0a..73468b8e24 100644 --- a/eng/common/core-templates/job/publish-build-assets.yml +++ b/eng/common/core-templates/job/publish-build-assets.yml @@ -187,10 +187,10 @@ jobs: PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} is1ESPipeline: ${{ parameters.is1ESPipeline }} - # Darc is targeting 8.0, so make sure it's installed + # Darc is targeting 10.0, so make sure it's installed - task: UseDotNet@2 inputs: - version: 8.0.x + version: 10.0.x - task: AzureCLI@2 displayName: Publish Using Darc diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml index 135fc9a505..fbdd0eadc6 100644 --- a/eng/common/core-templates/post-build/post-build.yml +++ b/eng/common/core-templates/post-build/post-build.yml @@ -355,10 +355,10 @@ stages: - template: /eng/common/templates/steps/enable-internal-runtimes.yml - # Darc is targeting 8.0, so make sure it's installed + # Darc is targeting 10.0, so make sure it's installed - task: UseDotNet@2 inputs: - version: 8.0.x + version: 10.0.x - task: AzureCLI@2 displayName: Publish Using Darc diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 295f26c351..c8b1f9d256 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -35,7 +35,8 @@ [bool]$warnAsError = if (Test-Path variable:warnAsError) { $warnAsError } else { $true } # Specifies semi-colon delimited list of warning codes that should not be treated as errors. -[string]$warnNotAsError = if (Test-Path variable:warnNotAsError) { $warnNotAsError } else { '' } +# Defaults to NuGet Audit warning codes NU1901-NU1904. +[string]$warnNotAsError = if ((Test-Path variable:warnNotAsError) -and $warnNotAsError) { $warnNotAsError } else { 'NU1901;NU1902;NU1903;NU1904' } # Specifies which msbuild engine to use for build: 'vs', 'dotnet' or unspecified (determined based on presence of tools.vs in global.json). [string]$msbuildEngine = if (Test-Path variable:msbuildEngine) { $msbuildEngine } else { $null } diff --git a/eng/common/tools.sh b/eng/common/tools.sh index df76f062a7..28ec1a491e 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -53,7 +53,8 @@ fi warn_as_error=${warn_as_error:-true} # Specifies semi-colon delimited list of warning codes that should not be treated as errors. -warn_not_as_error=${warn_not_as_error:-''} +# Defaults to NuGet Audit warning codes NU1901-NU1904. +warn_not_as_error="${warn_not_as_error:-NU1901;NU1902;NU1903;NU1904}" # True to attempt using .NET Core already that meets requirements specified in global.json # installed on the machine instead of downloading one. diff --git a/global.json b/global.json index 565c9e2103..c4c916ad40 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.114", + "version": "10.0.115", "allowPrerelease": true, "rollForward": "latestFeature", "paths": [ @@ -10,9 +10,9 @@ "errorMessage": "The required .NET SDK wasn't found. Please run ./eng/common/dotnet.cmd/sh to install it." }, "tools": { - "dotnet": "10.0.114" + "dotnet": "10.0.115" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26554.114" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26563.110" } } From 3b817b2aa535bc3dd2ee103353795d3263bf5a4a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 23 Nov 2026 05:05:25 +0000 Subject: [PATCH 5/7] Backflow from https://github.com/dotnet/dotnet / 24448ac build 342615 Diff: https://github.com/dotnet/dotnet/compare/e43baa62049eb55227dc78c1e7403793a2ffa7cb..24448ac060a3a39a57eb5dfdc28d2ca2b3e4b7ce From: https://github.com/dotnet/dotnet/commit/e43baa62049eb55227dc78c1e7403793a2ffa7cb To: https://github.com/dotnet/dotnet/commit/24448ac060a3a39a57eb5dfdc28d2ca2b3e4b7ce [[ commit created by automation ]] --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 8be9cfe2e4..2c8c21395b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -3,7 +3,7 @@ - 2.2.16 + 2.2.17 servicing From 459fec871ad5fa972851adbfc0645ff291ecd2e8 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 23 Nov 2026 05:05:26 +0000 Subject: [PATCH 6/7] Update dependencies from build 342615 Updated Dependencies: Microsoft.DotNet.Arcade.Sdk (Version 10.0.0-beta.26563.110 -> 10.0.0-beta.26571.110) [[ commit created by automation ]] --- eng/Version.Details.props | 2 +- eng/Version.Details.xml | 6 +++--- global.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 2112bdc27f..369cb8f8e0 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,7 +6,7 @@ This file should be imported by eng/Versions.props - 10.0.0-beta.26563.110 + 10.0.0-beta.26571.110 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 693bebeaed..c5e4d5a99c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,12 +1,12 @@ - + - + https://github.com/dotnet/dotnet - e43baa62049eb55227dc78c1e7403793a2ffa7cb + 24448ac060a3a39a57eb5dfdc28d2ca2b3e4b7ce diff --git a/global.json b/global.json index c4c916ad40..ed0b5201fb 100644 --- a/global.json +++ b/global.json @@ -13,6 +13,6 @@ "dotnet": "10.0.115" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26563.110" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26571.110" } } From 610968dec8a7ba782df5a5486ff43f0d79690f21 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 30 Nov 2026 05:04:14 +0000 Subject: [PATCH 7/7] Update dependencies from build 343446 Updated Dependencies: Microsoft.DotNet.Arcade.Sdk (Version 10.0.0-beta.26571.110 -> 10.0.0-beta.26576.111) [[ commit created by automation ]] --- eng/Version.Details.props | 2 +- eng/Version.Details.xml | 6 +- eng/common/Get-GitHubAppToken.ps1 | 103 +++++++++--------- .../core-templates/job/helix-job-monitor.yml | 1 + eng/common/core-templates/job/onelocbuild.yml | 4 +- .../steps/get-github-app-token.yml | 19 ++-- global.json | 2 +- 7 files changed, 68 insertions(+), 69 deletions(-) diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 369cb8f8e0..4fd03fda2e 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,7 +6,7 @@ This file should be imported by eng/Versions.props - 10.0.0-beta.26571.110 + 10.0.0-beta.26576.111 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c5e4d5a99c..cf6e0e1787 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,12 +1,12 @@ - + - + https://github.com/dotnet/dotnet - 24448ac060a3a39a57eb5dfdc28d2ca2b3e4b7ce + 71dafbffc59cbc91ed75afb59d9f78b0161badce diff --git a/eng/common/Get-GitHubAppToken.ps1 b/eng/common/Get-GitHubAppToken.ps1 index ec005e487c..8b26d303b4 100644 --- a/eng/common/Get-GitHubAppToken.ps1 +++ b/eng/common/Get-GitHubAppToken.ps1 @@ -1,11 +1,12 @@ # Mints a short-lived GitHub App installation access token by signing a JWT -# with an RSA private key (RS256). The signed JWT is exchanged with the GitHub -# API for a token scoped to a single installation. +# via Azure Key Vault's RSA signing operation (RS256). The private key never +# leaves Key Vault. The JWT is exchanged for a single installation's token. # # Requirements: -# - A GitHub App ID and PEM private key stored as Azure Key Vault secrets. -# - The federated Azure service connection running this script must have -# `Get` access to those two secrets. +# - The GitHub App's private key imported as a Key Vault RSA key. +# - Read access to the configured App-ID secret projection. +# - The federated Azure service connection must have the `Sign` action on +# that key. Reading private-key secrets is neither required nor supported. # - The App must be installed on the target organization/account # (`InstallationOwner`) with the permissions/repositories it needs. # @@ -14,17 +15,19 @@ [CmdletBinding()] param( - # Name of the Key Vault holding the GitHub App credentials. + # Key Vault holding the App-ID projection and RSA signing key. [Parameter(Mandatory = $true)] [string] $KeyVaultName, - # Secret Manager projection containing the GitHub App ID. + # Name of the RSA signing key, not a Key Vault secret. [Parameter(Mandatory = $true)] - [string] $AppIdSecretName, + [ValidateNotNullOrEmpty()] + [string] $KeyName, - # Secret Manager projection containing the PEM private key. + # Secret Manager projection containing the GitHub App's public ID. [Parameter(Mandatory = $true)] - [string] $AppPrivateKeySecretName, + [ValidateNotNullOrEmpty()] + [string] $AppIdSecretName, # Login of the organization or user account whose installation we should # mint the token for (e.g. `dotnet`, `microsoft`). @@ -51,55 +54,33 @@ function ConvertTo-Base64Url([byte[]] $bytes) { return [Convert]::ToBase64String($bytes).TrimEnd('=').Replace('+', '-').Replace('/', '_') } +Write-Host "Reading GitHub App ID from secret '$AppIdSecretName' in vault '$KeyVaultName'..." $previousNativeCommandErrorPreference = $PSNativeCommandUseErrorActionPreference try { - # Azure CLI can emit non-fatal Python warnings to stderr. $PSNativeCommandUseErrorActionPreference = $false - $keyVaultAccessToken = az account get-access-token ` + # az keyvault secret show fails for this projection with Errno 22; az rest keeps authentication in Azure CLI. + $escapedSecretName = [Uri]::EscapeDataString($AppIdSecretName) + $appId = az rest ` + --method get ` + --url "https://$KeyVaultName.vault.azure.net/secrets/${escapedSecretName}?api-version=7.4" ` --resource https://vault.azure.net ` - --query accessToken ` + --query value ` --output tsv ` --only-show-errors - $tokenExitCode = $LASTEXITCODE + $secretExitCode = $LASTEXITCODE } catch { - Write-PipelineTelemetryError -Category 'Build' -Message "Failed to acquire an Azure Key Vault access token: $_" + Write-PipelineTelemetryError -Category 'Build' -Message "Failed to read App ID secret '$AppIdSecretName' from vault '$KeyVaultName' with Azure CLI: $_" exit 1 } finally { $PSNativeCommandUseErrorActionPreference = $previousNativeCommandErrorPreference } -if ($tokenExitCode -ne 0 -or [string]::IsNullOrWhiteSpace($keyVaultAccessToken)) { - Write-PipelineTelemetryError -Category 'Build' -Message "'az account get-access-token' exited with code $tokenExitCode while acquiring an Azure Key Vault access token." +if ($secretExitCode -ne 0 -or [string]::IsNullOrWhiteSpace($appId)) { + Write-PipelineTelemetryError -Category 'Build' -Message "'az rest' failed with exit code $secretExitCode while reading App ID secret '$AppIdSecretName' from vault '$KeyVaultName'. Verify the service connection can read this App-ID projection." exit 1 } -function Get-KeyVaultSecret([string] $SecretName) { - # Use the data-plane REST API because `az keyvault secret show` can fail - # with Errno 22 on hosted Windows agents when reading these projections. - $escapedSecretName = [Uri]::EscapeDataString($SecretName) - $secretUri = "https://$KeyVaultName.vault.azure.net/secrets/$escapedSecretName`?api-version=7.4" - try { - $response = Invoke-RestMethod ` - -Uri $secretUri ` - -Headers @{ Authorization = "Bearer $keyVaultAccessToken" } ` - -Method Get - } - catch { - Write-PipelineTelemetryError -Category 'Build' -Message "Failed to read secret '$SecretName' from vault '$KeyVaultName': $_. Verify the secret exists and the service connection has 'Key Vault Secrets User' access to it." - exit 1 - } - if ([string]::IsNullOrWhiteSpace($response.value)) { - Write-PipelineTelemetryError -Category 'Build' -Message "Secret '$SecretName' in vault '$KeyVaultName' is empty." - exit 1 - } - return [string] $response.value -} - -Write-Host "Reading GitHub App credentials from vault '$KeyVaultName'..." -$appId = Get-KeyVaultSecret $AppIdSecretName -$privateKey = Get-KeyVaultSecret $AppPrivateKeySecretName - # Build JWT header and payload. Use [ordered] hashtables so JSON # serialization is deterministic. $jwtHeader = [ordered]@{ @@ -125,23 +106,34 @@ finally { $sha256.Dispose() } -Write-Host 'Signing JWT with the GitHub App private key...' -$rsa = [System.Security.Cryptography.RSA]::Create() +$digestBase64 = [Convert]::ToBase64String($digestBytes) +Write-Host "Signing JWT with key '$KeyName' in vault '$KeyVaultName'..." +$previousNativeCommandErrorPreference = $PSNativeCommandUseErrorActionPreference try { - $rsa.ImportFromPem($privateKey) - $signatureBytes = $rsa.SignHash( - $digestBytes, - [System.Security.Cryptography.HashAlgorithmName]::SHA256, - [System.Security.Cryptography.RSASignaturePadding]::Pkcs1) - $signatureUrl = ConvertTo-Base64Url $signatureBytes + # Azure CLI can emit non-fatal Python warnings to stderr. + $PSNativeCommandUseErrorActionPreference = $false + $signatureBase64 = az keyvault key sign ` + --vault-name $KeyVaultName ` + --name $KeyName ` + --algorithm RS256 ` + --digest $digestBase64 ` + --query signature ` + --output tsv ` + --only-show-errors + $signExitCode = $LASTEXITCODE } catch { - Write-PipelineTelemetryError -Category 'Build' -Message "Failed to sign the GitHub App JWT with the supplied private key: $_" + Write-PipelineTelemetryError -Category 'Build' -Message "Failed to sign the JWT via Key Vault (key '$KeyName', vault '$KeyVaultName'): $_. Verify the service connection has the Sign action on the key." exit 1 } finally { - $rsa.Dispose() + $PSNativeCommandUseErrorActionPreference = $previousNativeCommandErrorPreference +} +if ($signExitCode -ne 0 -or [string]::IsNullOrWhiteSpace($signatureBase64)) { + Write-PipelineTelemetryError -Category 'Build' -Message "'az keyvault key sign' exited with code $signExitCode for key '$KeyName' in vault '$KeyVaultName'. Verify the service connection has the Sign action on the key." + exit 1 } +$signatureUrl = $signatureBase64.Trim().TrimEnd('=').Replace('+', '-').Replace('/', '_') $jwt = "$signingInput.$signatureUrl" $headers = @{ @@ -198,6 +190,11 @@ catch { exit 1 } +if ([string]::IsNullOrWhiteSpace($tokenResponse.token)) { + Write-PipelineTelemetryError -Category 'Build' -Message "GitHub returned an empty installation token for '$InstallationOwner'." + exit 1 +} + Write-Host "Got installation token for '$InstallationOwner' (expires $($tokenResponse.expires_at))." if ($OutputVariableName) { Write-Host "Setting pipeline variable '$OutputVariableName'." diff --git a/eng/common/core-templates/job/helix-job-monitor.yml b/eng/common/core-templates/job/helix-job-monitor.yml index a3dd1ab534..7927c36414 100644 --- a/eng/common/core-templates/job/helix-job-monitor.yml +++ b/eng/common/core-templates/job/helix-job-monitor.yml @@ -172,6 +172,7 @@ jobs: steps: - checkout: self fetchDepth: 1 + fetchTags: false - ${{ if and(eq(parameters.useEntraAuthentication, true), eq(parameters.azureSubscription, '')) }}: - pwsh: throw "azureSubscription must be set when useEntraAuthentication is true." diff --git a/eng/common/core-templates/job/onelocbuild.yml b/eng/common/core-templates/job/onelocbuild.yml index 5e398434ec..2647afdf3f 100644 --- a/eng/common/core-templates/job/onelocbuild.yml +++ b/eng/common/core-templates/job/onelocbuild.yml @@ -12,7 +12,7 @@ parameters: GitHubAppServiceConnection: 'dnceng-oneloc-githubapp' GitHubAppKeyVaultName: 'EngKeyVault' GitHubAppIdSecretName: 'oneloc-localization-app-app-id' - GitHubAppPrivateKeySecretName: 'oneloc-localization-app-app-private-key' + GitHubAppKeyName: 'oneloc-localization-app-key' SourcesDirectory: $(System.DefaultWorkingDirectory) CreatePr: true @@ -102,7 +102,7 @@ jobs: azureSubscription: ${{ parameters.GitHubAppServiceConnection }} keyVaultName: ${{ parameters.GitHubAppKeyVaultName }} appIdSecretName: ${{ parameters.GitHubAppIdSecretName }} - appPrivateKeySecretName: ${{ parameters.GitHubAppPrivateKeySecretName }} + keyName: ${{ parameters.GitHubAppKeyName }} installationOwner: ${{ parameters.GitHubOrg }} outputVariableName: 'GitHubAppInstallationToken' condition: ${{ parameters.condition }} diff --git a/eng/common/core-templates/steps/get-github-app-token.yml b/eng/common/core-templates/steps/get-github-app-token.yml index 3eeb5a4c1b..66c6440e8a 100644 --- a/eng/common/core-templates/steps/get-github-app-token.yml +++ b/eng/common/core-templates/steps/get-github-app-token.yml @@ -1,11 +1,12 @@ # Mints a short-lived GitHub App installation access token by signing a JWT -# with an RSA private key (RS256). The JWT is exchanged with the GitHub API -# for a token scoped to a single installation. +# via Azure Key Vault's RSA signing operation (RS256), without reading the +# private key. The JWT is exchanged for a single installation's token. # # Requirements (per GitHub App you want to authenticate as): -# - A GitHub App ID and PEM private key stored as Azure Key Vault secrets. +# - The GitHub App's private key imported as a Key Vault RSA key. +# - Read access to the configured App-ID secret projection. # - The Azure service connection passed via `azureSubscription` must have -# `Get` access to those two secrets. +# the `Sign` action on that key. # - The App must be installed on the target organization/account # (`installationOwner`) with the permissions/repositories you need. # @@ -15,18 +16,18 @@ # enterprise classic-PAT lifetime policy. parameters: -# Azure DevOps service connection (federated) that can read the App credentials. +# Federated service connection authorized to sign with the App's RSA key. - name: azureSubscription type: string -# Name of the Key Vault holding Secret Manager's github-app-secret projections. +# Name of the Key Vault holding the App's RSA key. - name: keyVaultName type: string -- name: appIdSecretName +- name: keyName type: string -- name: appPrivateKeySecretName +- name: appIdSecretName type: string # Login of the organization or user account whose installation we should @@ -66,7 +67,7 @@ steps: inlineScript: | & "$(System.DefaultWorkingDirectory)/eng/common/Get-GitHubAppToken.ps1" ` -KeyVaultName '${{ parameters.keyVaultName }}' ` + -KeyName '${{ parameters.keyName }}' ` -AppIdSecretName '${{ parameters.appIdSecretName }}' ` - -AppPrivateKeySecretName '${{ parameters.appPrivateKeySecretName }}' ` -InstallationOwner '${{ parameters.installationOwner }}' ` -OutputVariableName '${{ parameters.outputVariableName }}' diff --git a/global.json b/global.json index ed0b5201fb..90a2923919 100644 --- a/global.json +++ b/global.json @@ -13,6 +13,6 @@ "dotnet": "10.0.115" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26571.110" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26576.111" } }