async def METHOD_NAME():
    """Preflight checks."""
    event_data = get_event_data()
    ref: str | None = None
    hacs = HacsBase()
    try:
        hacs.hass = HomeAssistant()  # pylint: disable=no-value-for-parameter
    except TypeError:
        hacs.hass = HomeAssistant("")  # pylint: disable=too-many-function-args
    hacs.system.action = True
    hacs.configuration.token = TOKEN
    hacs.core.config_path = None
    async with aiohttp.ClientSession() as session:
        hacs.session = session
        hacs.validation = ValidationManager(hacs=hacs, hass=hacs.hass)
        hacs.githubapi = GitHubAPI(
            token=hacs.configuration.token,
            session=session,
            **{"client_name": "HACS/Action"},
        )
        if REPOSITORY and CATEGORY:
            repository = REPOSITORY
            category = CATEGORY
        elif GITHUB_REPOSITORY == HacsGitHubRepo.DEFAULT:
            category = chose_category()
            repository = await chose_repository(hacs.githubapi, category)
            LOGGER.info(f"Actor: {GITHUB_ACTOR}")
        else:
            category = CATEGORY.lower()
            if event_data.get("pull_request") is not None:
                head = event_data["pull_request"]["head"]
                ref = head["ref"]
                repository = head["repo"]["full_name"]
            else:
                repository = GITHUB_REPOSITORY
                if event_data.get("ref") is not None:
                    # For push events
                    ref = event_data["ref"]
                    # For tag events
                    if ref.startswith("refs/tags/"):
                        ref = ref.split("/")[-1]
        LOGGER.info(f"Category: {category}")
        LOGGER.info(f"Repository: {repository}{f'@{ref}' if ref else ''}")
        if TOKEN is None:
            error("No GitHub token found, use env GITHUB_TOKEN to set this.")
        if repository is None:
            error("No repository found, use env REPOSITORY to set this.")
        if category is None:
            error("No category found, use env CATEGORY to set this.")
        if ref is None and GITHUB_REPOSITORY != HacsGitHubRepo.DEFAULT:
            repo = await hacs.githubapi.repos.get(repository)
            ref = repo.data.default_branch
        await validate_repository(hacs, repository, category, ref)