Skip to content

Commit

Permalink
Create api review script changes to add a param to set release tag (#…
Browse files Browse the repository at this point in the history
…1549)

Co-authored-by: Praveen Kuttappan <[email protected]>
  • Loading branch information
azure-sdk and praveenkuttappan authored Mar 18, 2024
1 parent dc02b07 commit 77896e9
Show file tree
Hide file tree
Showing 3 changed files with 300 additions and 113 deletions.
19 changes: 14 additions & 5 deletions eng/common/pipelines/templates/steps/create-apireview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,37 @@ parameters:
ArtifactPath: $(Build.ArtifactStagingDirectory)
Artifacts: []
ConfigFileDir: $(Build.ArtifactStagingDirectory)/PackageInfo
MarkPackageAsShipped: false
GenerateApiReviewForManualOnly: false
ArtifactName: 'packages'
PackageName: ''

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

- ${{ each artifact in parameters.Artifacts }}:
# 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
arguments: >
-ArtifactList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object Name)
-ArtifactPath ${{parameters.ArtifactPath}}
-APIViewUri $(azuresdk-apiview-uri)
-ArtifactName ${{ parameters.ArtifactName }}
-APIKey $(azuresdk-apiview-apikey)
-APILabel "Auto Review - $(Build.SourceVersion)"
-PackageName ${{artifact.name}}
-PackageName '${{parameters.PackageName}}'
-SourceBranch $(Build.SourceBranchName)
-DefaultBranch $(DefaultBranch)
-ConfigFileDir '${{parameters.ConfigFileDir}}'
-BuildId $(Build.BuildId)
-RepoName '$(Build.Repository.Name)'
-MarkPackageAsShipped $${{parameters.MarkPackageAsShipped}}
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Create API Review for ${{ artifact.name}}
displayName: Create API Review
condition: >-
and(
succeededOrFailed(),
Expand Down
Loading

0 comments on commit 77896e9

Please sign in to comment.