Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/http-client-csharp/eng/pipeline/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,17 @@ extends:
$commitSha = '$(Build.SourceVersion)'
$typeSpecCommitUrl = "$repoUrl/commit/$commitSha"

# Compute the URL to this pipeline run for inclusion in the generated PR
$collectionUri = '$(System.CollectionUri)'.TrimEnd('/')
$teamProject = '$(System.TeamProject)'
$buildId = '$(Build.BuildId)'
$pipelineRunUrl = "$collectionUri/$teamProject/_build/results?buildId=$buildId&view=results"

Write-Host "Commit SHA: $commitSha"
Write-Host "TypeSpec Commit URL: $typeSpecCommitUrl"
Write-Host "Pipeline Run URL: $pipelineRunUrl"
Write-Host "##vso[task.setvariable variable=TypeSpecCommitUrl]$typeSpecCommitUrl"
Write-Host "##vso[task.setvariable variable=PipelineRunUrl]$pipelineRunUrl"
displayName: Set variables for PR creation

- task: UseNode@1
Expand Down Expand Up @@ -233,6 +241,7 @@ extends:
-TypeSpecCommitUrl '$(TypeSpecCommitUrl)'
-AuthToken '$(GH_TOKEN)'
-TypeSpecSourcePackageJsonPath '$(Build.SourcesDirectory)/packages/http-client-csharp/package.json'
-PipelineRunUrl '$(PipelineRunUrl)'
${{ replace(replace('True', eq(variables['Build.SourceBranchName'], 'main'), ''), 'True', '-Internal') }}
${{ replace(replace('True', eq(parameters.RegenerateAzureLibraries, false), ''), 'True', '-RegenerateAzureLibraries') }}
${{ replace(replace('True', eq(parameters.RegenerateMgmtLibraries, false), ''), 'True', '-RegenerateMgmtLibraries') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ When specified, builds the Azure emitter locally and regenerates Azure data plan
When specified, builds the management plane emitter locally and regenerates mgmt SDK libraries. Implies Azure emitter build since mgmt depends on it.
.PARAMETER BuildArtifactsPath
Path to the build artifacts directory containing the published .tgz and .nupkg files. Required when RegenerateAzureLibraries or RegenerateMgmtLibraries is specified.
.PARAMETER PipelineRunUrl
The URL of the pipeline run that triggered this PR. When provided, it is included in the PR description for traceability.
#>
[CmdletBinding(SupportsShouldProcess = $true)]
param(
Expand Down Expand Up @@ -49,6 +51,9 @@ param(
[Parameter(Mandatory = $false)]
[string]$BuildArtifactsPath,

[Parameter(Mandatory = $false)]
[string]$PipelineRunUrl,

[Parameter(Mandatory = $false)]
[switch]$UseTypeSpecNext
)
Expand Down Expand Up @@ -80,7 +85,12 @@ This PR updates the UnbrandedGeneratorVersion property in eng/centralpackagemana

## Details

- TypeSpec commit that triggered this PR: $TypeSpecCommitUrl
- TypeSpec commit that triggered this PR: $TypeSpecCommitUrl$(if ($PipelineRunUrl) {
@"

- Pipeline run that produced this PR: $PipelineRunUrl
"@
})

## Changes

Expand Down
Loading