File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 34
34
filePath : $(Build.SourcesDirectory)\Localize\update-locproject.ps1
35
35
arguments : -SourcesDirectory "$(Build.SourcesDirectory)" -LocProjectPath "$(Build.SourcesDirectory)\Localize\LocProject.json"
36
36
37
+ # https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-security-configuration/configuration-guides/pat-burndown-guidance#authentication-from-pipelines
38
+ # Requires Azure client 2.x
39
+ - task : AzureCLI@2
40
+ displayName : ' Set AzDO.OneLocBuildToken'
41
+ enabled : true
42
+ inputs :
43
+ azureSubscription : ' VSEng-AzureDevOps-ceapex-OneLocBuild' # Azure DevOps service connection
44
+ scriptType : ' pscore'
45
+ scriptLocation : ' inlineScript'
46
+ inlineScript : |
47
+ # if this fails, check out this bash script that includes diagnostics:
48
+ # https://gist.github.com/johnterickson/19f80a3e969e39f1000d118739176e62
49
+ # Note that the resource is specified to limit the token to Azure DevOps
50
+ $token = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
51
+ Write-Host "##vso[task.setvariable variable=AzDO.OneLocBuildToken;issecret=true]${token}"
52
+
37
53
- task : OneLocBuild@2
38
54
displayName : OneLocBuild
39
55
env :
42
58
locProj : Localize/LocProject.json
43
59
outDir : $(Build.StagingDirectory)
44
60
packageSourceAuth : patAuth
45
- patVariable : $(OneLocBuild--PAT )
61
+ patVariable : $(AzDO.OneLocBuildToken )
46
62
isCreatePrSelected : true
47
63
repoType : gitHub
48
64
gitHubPatVariable : $(github--pat--vs-mobiletools-engineering-service2)
You can’t perform that action at this time.
0 commit comments