From 7af1e39c270d6533304a25c971933f4e30f71712 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 7 Mar 2022 17:02:52 -0800 Subject: [PATCH] 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 --- .../pipelines/templates/steps/detect-api-changes.yml | 7 +++++++ eng/common/scripts/Detect-Api-Changes.ps1 | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/detect-api-changes.yml b/eng/common/pipelines/templates/steps/detect-api-changes.yml index 82669a631..833175ad7 100644 --- a/eng/common/pipelines/templates/steps/detect-api-changes.yml +++ b/eng/common/pipelines/templates/steps/detect-api-changes.yml @@ -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')) diff --git a/eng/common/scripts/Detect-Api-Changes.ps1 b/eng/common/scripts/Detect-Api-Changes.ps1 index fd5cdb68b..fc55e672b 100644 --- a/eng/common/scripts/Detect-Api-Changes.ps1 +++ b/eng/common/scripts/Detect-Api-Changes.ps1 @@ -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/") )