Skip to content

Commit f9374d9

Browse files
authored
Pass through System.AccessToken when real signing on non-Windows builds (#396)
1 parent 8eb458b commit f9374d9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

azure-pipelines/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ jobs:
246246
parameters:
247247
Is1ESPT: ${{ parameters.Is1ESPT }}
248248
RunTests: ${{ parameters.RunTests }}
249+
BuildRequiresAccessToken: ${{ parameters.RealSign }} # Real signing on non-Windows machines requires passing through access token to build steps that sign
249250
- ${{ if parameters.EnableDotNetFormatCheck }}:
250251
- script: dotnet format --verify-no-changes
251252
displayName: 💅 Verify formatted code
@@ -282,6 +283,7 @@ jobs:
282283
parameters:
283284
Is1ESPT: ${{ parameters.Is1ESPT }}
284285
RunTests: ${{ parameters.RunTests }}
286+
BuildRequiresAccessToken: ${{ parameters.RealSign }} # Real signing on non-Windows machines requires passing through access token to build steps that sign
285287
- template: expand-template.yml
286288

287289
- job: WrapUp

azure-pipelines/dotnet.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ parameters:
55
default: false
66
- name: Is1ESPT
77
type: boolean
8+
- name: BuildRequiresAccessToken
9+
type: boolean
10+
default: false
811

912
steps:
1013

1114
- script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904,LOCTASK002 /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog"
1215
displayName: 🛠 dotnet build
16+
${{ if parameters.BuildRequiresAccessToken }}:
17+
env:
18+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
1319

1420
- ${{ if not(parameters.IsOptProf) }}:
1521
- powershell: tools/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults

0 commit comments

Comments
 (0)