# component detection for component governance checks
parameters:
- name: condition
  type: string
  default: 'succeeded' # could be 'ci_only', 'always', 'succeeded'

steps:
- ${{ if eq(variables['System.TeamProject'], 'Lotus') }}: 
  - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
    displayName: 'Component Detection'
    condition:
      or(or(and(eq('${{parameters.condition}}', 'ci_only'), and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Scheduled'))),
          and(eq('${{parameters.condition}}', 'always'), always())),
          and(eq('${{parameters.condition}}', 'succeeded'), succeeded()))