Sync eng/common directory with azure-sdk-tools for PR 2875 (#3396)

* Support staging URl to run detect API changes in test env

* Remove empty line

Co-authored-by: praveenkuttappan <prmarott@microsoft.com>
This commit is contained in:
Azure SDK Bot 2022-03-07 17:02:52 -08:00 committed by GitHub
parent bd822a458b
commit 7af1e39c27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,12 @@ parameters:
Artifacts: []
steps:
- pwsh: |
$apiChangeDetectRequestUrl = "https://apiview.dev/PullRequest/DetectApiChanges"
echo "##vso[task.setvariable variable=ApiChangeDetectRequestUrl]$apiChangeDetectRequestUrl"
displayName: "Set API change detect request URL"
condition: eq(variables['ApiChangeDetectRequestUrl'], '')
- task: Powershell@2
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Detect-Api-Changes.ps1
@ -13,6 +19,7 @@ steps:
-BuildId $(Build.BuildId)
-PullRequestNumber $(System.PullRequest.PullRequestNumber)
-RepoFullName $(Build.Repository.Name)
-APIViewUri $(ApiChangeDetectRequestUrl)
pwsh: true
displayName: Detect API changes
condition: and(succeededOrFailed(), eq(variables['Build.Reason'],'PullRequest'))

View File

@ -10,9 +10,9 @@ Param (
[string] $CommitSha,
[Parameter(Mandatory=$True)]
[array] $ArtifactList,
[string] $APIViewUri,
[string] $RepoFullName = "",
[string] $ArtifactName = "packages",
[string] $APIViewUri = "https://apiview.dev/PullRequest/DetectApiChanges",
[string] $TargetBranch = ("origin/${env:SYSTEM_PULLREQUEST_TARGETBRANCH}" -replace "refs/heads/")
)