code: def get_active_airflow_versions(confirm: bool = True) -> list[str]:
      """
      Gets list of active Airflow versions from GitHub.
  
      :param confirm: if True, will ask the user before proceeding with the versions found
      :return: list of active Airflow versions
      """
      from git import GitCommandError, Repo
      from packaging.version import Version
  
      get_console().print(
          "\n[warning]Make sure you have `apache` remote added pointing to apache/airflow repository\n"
      )
      get_console().print(
          "[info]Fetching all released Airflow 2 versions from GitHub[/]\n"
      )
      repo = Repo(AIRFLOW_SOURCES_ROOT)
      all_active_tags: list[str] = []
      try:
          ref_tags = repo.git.ls_remote("--tags", "apache").splitlines()
      except GitCommandError as ex:
          get_console().print(
              "[error]Could not fetch tags from `apache` remote! Make sure to have it configured.\n"
          )
          get_console().print(f"{ex}\n")
          get_console().print(
              "[info]You can add apache remote with on of those commands (depend which protocol you use):\n"
              " * git remote add apache https://github.com/apache/airflow.git\n"
              " * git remote add apache git@github.com:apache/airflow.git\n"
          )
          sys.exit(1)
      tags = [
          tag.split("refs/tags/")[1].strip()
          for tag in ref_tags
          if "refs/tags/" in tag
      ]
      for tag in tags:
          match = ACTIVE_TAG_MATCH.match(tag)
          if match and match.group(1) == "2":
              all_active_tags.append(tag)
      airflow_versions = sorted(all_active_tags, key=Version)
      if confirm:
          get_console().print(
              f"All Airflow 2 versions: {all_active_tags}"
          )
          answer = user_confirm(
              "Should we continue with those versions?",
              quit_allowed=False,
              default_answer=Answer.YES,
          )
          if answer == Answer.NO:
              get_console().print("[red]Aborting[/]")
              sys.exit(1)
      return airflow_versions
  
file_path: airflow/dev/breeze/src/airflow_breeze/utils/github.py
imports: from __future__ import annotations
  import re
  import sys
  from datetime import datetime
  from pathlib import Path
  from typing import Any
  from rich.markup import escape
  from airflow_breeze.utils.confirm import Answer, user_confirm
  from airflow_breeze.utils.console import get_console
  from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT
  from airflow_breeze.utils.shared_options import get_dry_run
label_desc: Use image node_id 3 for calling a global function with example usage: get_active_airflow_versions(confirm) and returns: airflow_versions