Skip to content

Commit

Permalink
Make create apireview runnable from non default working directory (#8216
Browse files Browse the repository at this point in the history
)

* Make create apireview runnable from non default working directory
  • Loading branch information
praveenkuttappan authored May 16, 2024
1 parent 0b8b5c8 commit 989d023
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions eng/common/pipelines/templates/steps/create-apireview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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(
Expand Down

0 comments on commit 989d023

Please sign in to comment.