- name: Use specified version
  set_fact:
    istio_version_to_use: "{{ istio.release_tag_name }}"
  when: istio.release_tag_name != ''

- name: Set non-empty Authorization header dictionary
  set_fact:
    github_api_authorization_header:
      Authorization: "{{'token ' + github_api_token}}"
  when:  github_api_token != ''

- name: Set empty Authorization header dictionary
  set_fact:
    github_api_authorization_header: {}
  when:  github_api_token == ''

- name: Set HTTP headers to use
  set_fact:
    github_api_http_headers: "{{ default_github_api_headers | combine(github_api_authorization_header)}}"

- include_tasks: determine_latest_version.yml
  when: istio.release_tag_name == ''

- name: Show Istio version to be used
  debug:
    msg: "Will use Istio version {{ istio_version_to_use }}"