@@ -100,6 +100,7 @@ extends:
100
100
101
101
- task : PowerShell@2
102
102
displayName : ' Run initialize script'
103
+ name : initialize
103
104
inputs :
104
105
pwsh : true
105
106
filePath : $(Build.SourcesDirectory)/eng/scripts/typespec/Initialize-WorkingDirectory.ps1
@@ -117,7 +118,6 @@ extends:
117
118
118
119
- task : PowerShell@2
119
120
displayName : ' Run build script'
120
- name : ci_build
121
121
inputs :
122
122
pwsh : true
123
123
filePath : $(Build.SourcesDirectory)/eng/scripts/typespec/Build-Emitter.ps1
@@ -206,7 +206,6 @@ extends:
206
206
207
207
# Regenerate stage
208
208
# Responsible for regenerating the SDK code using the emitter package and the generation matrix.
209
- # Creates a pull request to the `main` branch with the regened changes and updated emitter-package and emitter-package-lock files.
210
209
- ${{ if and(parameters.ShouldPublish, parameters.ShouldRegenerate) }} :
211
210
- stage : Regenerate
212
211
dependsOn :
@@ -327,7 +326,7 @@ extends:
327
326
- Generate
328
327
variables :
329
328
generateJobResult : $[dependencies.Generate.result]
330
- emitterVersion : $[stageDependencies.Build.Build.outputs['ci_build .emitterVersion']]
329
+ emitterVersion : $[stageDependencies.Build.Build.outputs['initialize .emitterVersion']]
331
330
steps :
332
331
- template : /eng/common/pipelines/templates/steps/sparse-checkout.yml
333
332
@@ -387,6 +386,16 @@ extends:
387
386
} else {
388
387
Write-Error "Build.Repository.Name not in the expected {Owner}/{Name} format"
389
388
}
389
+
390
+ $openAsDraft = -not ($reason -eq 'IndividualCI' -and $sourceBranch -eq 'refs/heads/main')
391
+ Write-Host "Setting OpenAsDraftBool = $openAsDraft"
392
+ Write-Host "##vso[task.setvariable variable=OpenAsDraft]$openAsDraft"
393
+ if ($openAsDraft) {
394
+ Write-Host "##vso[task.setvariable variable=PRLabels]Do Not Merge"
395
+ } else {
396
+ Write-Host "##vso[task.setvariable variable=PRLabels]"
397
+ }
398
+
390
399
displayName: Get PR title and body
391
400
392
401
- task : PowerShell@2
@@ -403,8 +412,8 @@ extends:
403
412
-AuthToken '$(azuresdk-github-pat)'
404
413
-PRTitle '$(PullRequestTitle)'
405
414
-PRBody '$(PullRequestBody)'
406
- -OpenAsDraft $true
407
- -PRLabels 'Do Not Merge '
415
+ -OpenAsDraft $$(OpenAsDraft)
416
+ -PRLabels '$(PRLabels) '
408
417
workingDirectory : $(Build.SourcesDirectory)
409
418
410
419
# Test stage
0 commit comments