diff --git a/eng/common/pipelines/templates/steps/create-apireview.yml b/eng/common/pipelines/templates/steps/create-apireview.yml index c69d05d5ae3..f19a78f9c0c 100644 --- a/eng/common/pipelines/templates/steps/create-apireview.yml +++ b/eng/common/pipelines/templates/steps/create-apireview.yml @@ -6,18 +6,21 @@ parameters: GenerateApiReviewForManualOnly: false ArtifactName: 'packages' PackageName: '' + SourceRootPath: $(Build.SourcesDirectory) steps: # ideally this should be done as initial step of a job in caller template # We can remove this step later once it is added in caller - template: /eng/common/pipelines/templates/steps/set-default-branch.yml + parameters: + WorkingDirectory: ${{ parameters.SourceRootPath }} # Automatic API review is generated for a package when pipeline runs irrespective of how pipeline gets triggered. # Below condition ensures that API review is generated only for manual pipeline runs when flag GenerateApiReviewForManualOnly is set to true. - ${{ if or(ne(parameters.GenerateApiReviewForManualOnly, true), eq(variables['Build.Reason'], 'Manual')) }}: - task: Powershell@2 inputs: - filePath: $(Build.SourcesDirectory)/eng/common/scripts/Create-APIReview.ps1 + filePath: ./eng/common/scripts/Create-APIReview.ps1 arguments: > -ArtifactList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object Name) -ArtifactPath ${{parameters.ArtifactPath}} @@ -31,7 +34,7 @@ steps: -RepoName '$(Build.Repository.Name)' -MarkPackageAsShipped $${{parameters.MarkPackageAsShipped}} pwsh: true - workingDirectory: $(Pipeline.Workspace) + workingDirectory: ${{ parameters.SourceRootPath }} displayName: Create API Review condition: >- and(