Skip to content

Commit 11926f3

Browse files
authored
Merge ed90cf9 into 1b8d54e
2 parents 1b8d54e + ed90cf9 commit 11926f3

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
"pkcs",
200200
"Pkcs",
201201
"pscredential",
202+
"pscore",
202203
"psscriptanalyzer",
203204
"PUCHAR",
204205
"PVOID",

eng/pipelines/templates/stages/archetype-cpp-release.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,23 @@ stages:
195195
OpenAsDraft: ${{ parameters.TestPipeline }}
196196
CloseAfterOpenForTesting: '${{ parameters.TestPipeline }}'
197197

198+
- task: AzureCLI@2
199+
displayName: Authenticate to OpenSource API
200+
inputs:
201+
azureSubscription: opensource-api-connection
202+
scriptType: pscore
203+
scriptLocation: inlineScript
204+
inlineScript: |
205+
$jwt_accessToken = az account get-access-token --resource "api://2789159d-8d8b-4d13-b90b-ca29c1707afd" --query "accessToken" --output tsv
206+
Write-Host "##vso[task.setvariable variable=opensource-api-token;isSecret=true]$jwt_accessToken"
207+
198208
# Workaround: -Fallback uses names from CODEOWNERS who
199209
# should be notified about the release in the event of a
200210
# failure to resolve the appropriate aliases.
201211
- pwsh: |
202212
$notifyUsers = ./eng/scripts/Get-TriggeringUserGitHubAlias.ps1 `
203213
-EmailAddress "$($env:BUILD_REQUESTEDFOREMAIL)" `
204-
-ClientId '$(opensource-aad-app-id)' `
205-
-ClientSecret '$(opensource-aad-secret)' `
206-
-TenantId '$(opensource-aad-tenant-id)' `
214+
-OpenApiToken "$(opensource-api-token)"
207215
-Fallback '@rickwinter @ahsonkhan @antkmsft @gearama @LarryOsterman'
208216
209217
$prComment = "Adding ${{ artifact.Name }} to release"

eng/scripts/Get-TriggeringUserGitHubAlias.ps1

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
param(
22
[string] $EmailAddress = $env:BUILD_REQUESTEDFOREMAIL,
3-
[string] $ClientId,
4-
[string] $ClientSecret,
5-
[string] $TenantId,
3+
[string] $OpenApiToken,
64
[string] $Fallback
75
)
86

97
. "$PSScriptRoot/../common/scripts/Helpers/Metadata-Helpers.ps1"
108

11-
$allUsers = GetAllGitHubUsers `
12-
-TenantId $TenantId `
13-
-ClientId $ClientId `
14-
-ClientSecret $ClientSecret
9+
$allUsers = GetAllGitHubUsers -Token $OpenApiToken
1510

1611
if (!$allUsers) {
1712
Write-Host "Failed to get all GitHub users"

0 commit comments

Comments
 (0)