parameters:
- name: version
  type: string
  default: '3.12'

- name: architecture
  type: string
  default: 'x64'

steps:
  - task: UsePythonVersion@0
    inputs:
      architecture: ${{ parameters.architecture }}
      versionSpec: ${{ parameters.version }}
      disableDownloadFromRegistry: false # boolean. Disable downloading releases from the GitHub registry. Default: false.
      allowUnstable: true # boolean. Optional. Use when disableDownloadFromRegistry = false. Allow downloading unstable releases. Default: false.
      githubToken: $(githubToken) # global (secret) variable to allow API access to Github (for not hitting a rate limit while downloading).
  - bash: |
      echo AGENT_JOBSTATUS = $AGENT_JOBSTATUS
      if [[ "$AGENT_JOBSTATUS" == "SucceededWithIssues" ]]; then exit 1; fi
    displayName: Python ${{ parameters.version }} set as interpreter.
