TEMP: Enable TestAuthOnly for pipeline testing

This commit is contained in:
Alitzel Mendez 2025-12-08 11:15:52 -08:00 committed by azure-sdk
parent e528dc9c10
commit 210faebfba

View File

@ -29,11 +29,26 @@ parameters:
- name: AzureServiceConnection
type: string
default: 'APIView prod deployment'
- name: TestAuthOnly
type: boolean
default: true # TEMPORARY: Set to true for testing Bearer auth, revert to false before merging
steps:
# Test authentication mode - just verify Bearer token works
- ${{ if eq(parameters.TestAuthOnly, true) }}:
- task: AzureCLI@2
inputs:
azureSubscription: ${{ parameters.AzureServiceConnection }}
scriptType: pscore
scriptLocation: scriptPath
scriptPath: ${{ parameters.SourceRootPath }}/eng/common/scripts/Create-APIReview.ps1
arguments: -TestAuth
displayName: Test APIView Bearer Token Authentication
condition: succeededOrFailed()
# 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')) }}:
- ${{ if and(ne(parameters.TestAuthOnly, true), or(ne(parameters.GenerateApiReviewForManualOnly, true), eq(variables['Build.Reason'], 'Manual'))) }}:
# 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