Skip to content

Commit a2027cd

Browse files
Add all updates (#7659)
1 parent 79b5198 commit a2027cd

File tree

2 files changed

+16
-30
lines changed

2 files changed

+16
-30
lines changed

packages/http-client-csharp/eng/pipeline/publish.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,13 @@ extends:
7575
- checkout: self
7676
- pwsh: |
7777
# Determine the TypeSpec PR URL
78-
$sourceBranch = '$(Build.SourceBranch)'
79-
$repoUrl = '$(Build.Repository.Uri)'
78+
$repoUrl = '$(Build.Repository.Uri)'.TrimEnd('/')
79+
$commitSha = '$(Build.SourceVersion)'
80+
$typeSpecCommitUrl = "$repoUrl/commit/$commitSha"
8081
81-
if ($sourceBranch -match "^refs/pull/(\d+)/(head|merge)$") {
82-
$typeSpecPRUrl = "$repoUrl/pull/$($Matches[1])"
83-
} elseif ($sourceBranch -match "^refs/heads/(.+)$") {
84-
$typeSpecPRUrl = "$repoUrl/tree/$($Matches[1])"
85-
} else {
86-
$typeSpecPRUrl = "$repoUrl/tree/$sourceBranch"
87-
}
88-
Write-Host "TypeSpec PR URL: $typeSpecPRUrl"
89-
Write-Host "##vso[task.setvariable variable=TypeSpecPRUrl]$typeSpecPRUrl"
82+
Write-Host "Commit SHA: $commitSha"
83+
Write-Host "TypeSpec Commit URL: $typeSpecCommitUrl"
84+
Write-Host "##vso[task.setvariable variable=TypeSpecCommitUrl]$typeSpecCommitUrl"
9085
displayName: Set variables for PR creation
9186
9287
- task: UseDotNet@2
@@ -101,5 +96,5 @@ extends:
10196
filePath: $(Build.SourcesDirectory)/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1
10297
arguments: >
10398
-PackageVersion '$(PackageVersion)'
104-
-TypeSpecPRUrl '$(TypeSpecPRUrl)'
99+
-TypeSpecCommitUrl '$(TypeSpecCommitUrl)'
105100
-AuthToken '$(azuresdk-github-pat)'

packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ param(
1818
[string]$PackageVersion,
1919

2020
[Parameter(Mandatory = $true)]
21-
[string]$TypeSpecPRUrl,
21+
[string]$TypeSpecCommitUrl,
2222

2323
[Parameter(Mandatory = $true)]
2424
[string]$AuthToken,
@@ -34,7 +34,6 @@ Import-Module (Join-Path $PSScriptRoot "Generation.psm1") -DisableNameChecking -
3434
$RepoOwner = "Azure"
3535
$RepoName = "azure-sdk-for-net"
3636
$BaseBranch = "main"
37-
$PROwner = "azure-sdk"
3837
$PRBranch = $BranchName
3938

4039
$PRTitle = "Update UnbrandedGeneratorVersion to $PackageVersion"
@@ -43,13 +42,14 @@ This PR updates the UnbrandedGeneratorVersion property in eng/Packages.Data.prop
4342
4443
## Details
4544
46-
- Original TypeSpec PR: $TypeSpecPRUrl
45+
- TypeSpec commit that triggered this PR: $TypeSpecCommitUrl
4746
4847
## Changes
4948
5049
- Updated eng/Packages.Data.props UnbrandedGeneratorVersion property
5150
- Updated eng/packages/http-client-csharp/package.json dependency version
5251
- Ran npm install to update package-lock.json
52+
- Ran eng/packages/http-client-csharp/eng/scripts/Generate.ps1 to regenerate test projects
5353
5454
This is an automated PR created by the TypeSpec publish pipeline.
5555
"@
@@ -169,26 +169,17 @@ try {
169169

170170
# Commit the changes
171171
Write-Host "Committing changes..."
172-
if ($propsFileUpdated) {
173-
git add eng/Packages.Data.props
174-
}
175-
if ($packageJsonUpdated) {
176-
git add eng/packages/http-client-csharp/package.json
177-
git add eng/packages/http-client-csharp/package-lock.json
178-
}
172+
git add eng/Packages.Data.props
173+
git add eng/packages/http-client-csharp/package.json
174+
git add eng/packages/http-client-csharp/package-lock.json
175+
git add eng/packages/http-client-csharp/generator/TestProjects/
176+
179177
if ($LASTEXITCODE -ne 0) {
180178
throw "Failed to add changes"
181179
}
182180

183181
# Build commit message based on what was updated
184-
$commitMessage = "Update UnbrandedGeneratorVersion to $PackageVersion`n"
185-
if ($propsFileUpdated) {
186-
$commitMessage += "`n- Updated eng/Packages.Data.props"
187-
}
188-
if ($packageJsonUpdated) {
189-
$commitMessage += "`n- Updated eng/packages/http-client-csharp/package.json"
190-
$commitMessage += "`n- Ran npm install to update package-lock.json"
191-
}
182+
$commitMessage = "Update UnbrandedGeneratorVersion to $PackageVersion"
192183

193184
git commit -m $commitMessage
194185
if ($LASTEXITCODE -ne 0) {

0 commit comments

Comments
 (0)