@@ -183,15 +183,13 @@ stages:
183183 failOnStderr : false
184184 workingDirectory : $(Build.SourcesDirectory)/autorest.csharp
185185 displayName : ' Update SDK codes and generator version in Azure SDK repo'
186- - template : /eng/common/pipelines/templates/steps/create-pull-request .yml@azure-sdk-tools
186+ - template : /eng/common/pipelines/templates/steps/git-push-changes .yml@azure-sdk-tools
187187 parameters :
188- BaseBranchName : main
189- RepoName : azure-sdk-for-net
190- PRBranchName : auto-update-autorest
188+ BaseRepoBranch : auto-update-autorest-$(AutorestCSharpVersion)
189+ BaseRepoOwner : azure-sdk
191190 CommitMsg : Update AutoRest C# version to $(AutorestCSharpVersion)
192- PRBody : Update AutoRest C# version to $(AutorestCSharpVersion)
193- PRTitle : Update AutoRest C# version
194- PushArgs : -f
191+ TargetRepoOwner : Azure
192+ TargetRepoName : $(Build.Repository.Name)
195193 WorkingDirectory : $(Build.SourcesDirectory)/azure-sdk-for-net
196194 ScriptDirectory : $(Build.SourcesDirectory)/azure-sdk-tools/eng/common/scripts
197195 - job : Update_Samples
@@ -214,14 +212,37 @@ stages:
214212 failOnStderr : false
215213 workingDirectory : $(Build.SourcesDirectory)/autorest.csharp
216214 displayName : ' Update sample codes and generator version in Azure SDK repo'
217- - template : /eng/common/pipelines/templates/steps/create-pull-request .yml@azure-sdk-tools
215+ - template : /eng/common/pipelines/templates/steps/git-push-changes .yml@azure-sdk-tools
218216 parameters :
219- BaseBranchName : main
220- RepoName : azure-sdk-for-net
221- PRBranchName : auto-update-autorest
217+ BaseRepoBranch : auto-update-autorest-$(AutorestCSharpVersion)
218+ BaseRepoOwner : azure-sdk
222219 CommitMsg : Update AutoRest C# version to $(AutorestCSharpVersion)
223- PRBody : Update AutoRest C# version to $(AutorestCSharpVersion)
224- PRTitle : Update AutoRest C# version
225- PushArgs : -f
220+ TargetRepoOwner : Azure
221+ TargetRepoName : $(Build.Repository.Name)
226222 WorkingDirectory : $(Build.SourcesDirectory)/azure-sdk-for-net
227223 ScriptDirectory : $(Build.SourcesDirectory)/azure-sdk-tools/eng/common/scripts
224+ - job : Create_PR
225+ dependsOn :
226+ - Update_Codes
227+ - Update_Samples
228+ variables :
229+ AutorestCSharpVersion : $[stageDependencies.Build_and_Test.Build.outputs['Package.AutorestCSharpVersion']]
230+ CadlEmitterVersion : $[stageDependencies.Build_and_Test.Build.outputs['Publish.CadlEmitterVersion']]
231+ steps :
232+ - checkout : self
233+ - checkout : azure-sdk-tools
234+ - task : PowerShell@2
235+ displayName : Create pull request
236+ condition : and(succeeded(), eq(variables['HasChanges'], 'true'))
237+ inputs :
238+ pwsh : true
239+ filePath : $(Build.SourcesDirectory)/azure-sdk-tools/eng/common/scripts/Submit-PullRequest.ps1
240+ arguments : >
241+ -RepoOwner "Azure"
242+ -RepoName "$(RepoNameWithoutOwner)"
243+ -BaseBranch "main"
244+ -PROwner "azure-sdk"
245+ -PRBranch "auto-update-autorest-$(AutorestCSharpVersion)"
246+ -AuthToken "$(azuresdk-github-pat)"
247+ -PRTitle "Update AutoRest C# version"
248+ -PRBody "$Update AutoRest C# version to $(AutorestCSharpVersion)"
0 commit comments