parameters:
- name: PackageName
  type: string
  default: 'not-specified'
- name: ServiceName
  type: string
  default: ''
- name: ServiceDirectory
  type: string
  default: ''
- name: ForRelease
  type: boolean
  default: false
- name: Condition
  type: string
  default: succeeded()

steps:
  - task: Powershell@2
    inputs:
      filePath: $(Build.SourcesDirectory)/eng/common/scripts/Verify-ChangeLog.ps1
      arguments: >
        -PackageName '${{ parameters.PackageName }}'
        -ServiceDirectory '${{ coalesce(parameters.ServiceDirectory, parameters.ServiceName) }}'
        -ForRelease $${{ parameters.ForRelease }}
      pwsh: true
      workingDirectory: $(Pipeline.Workspace)
    displayName: Verify ChangeLogEntry for ${{ parameters.PackageName }}
    condition: ${{ parameters.Condition }}
    continueOnError: false
