def METHOD_NAME(
    controller: GithubController,
    merge_method: t.Optional[MergeMethod],
    delete: bool,
    command_namespace: t.Optional[str] = None,
) -> None:
    has_required_approval = False
    if controller.is_comment_triggered:
        command = controller.get_command_from_comment(command_namespace)
        if command.is_invalid:
            # Probably a comment unrelated to SQLMesh so we do nothing
            return
        elif command.is_deploy_prod:
            has_required_approval = True
        else:
            raise CICDBotError(f"Unsupported command: {command}")
    controller.update_pr_environment_check(status=GithubCheckStatus.QUEUED)
    controller.update_prod_environment_check(status=GithubCheckStatus.QUEUED)
    controller.update_test_check(status=GithubCheckStatus.QUEUED)
    tests_passed = _run_tests(controller)
    if not has_required_approval and controller.do_required_approval_check:
        controller.update_required_approval_check(status=GithubCheckStatus.QUEUED)
        has_required_approval = _check_required_approvers(controller)
    else:
        controller.update_required_approval_check(
            status=GithubCheckStatus.COMPLETED, conclusion=GithubCheckConclusion.SKIPPED
        )
    pr_environment_updated = _update_pr_environment(controller)
    if tests_passed and has_required_approval and pr_environment_updated:
        _deploy_production(
            controller, merge_method=merge_method, delete_environment_after_deploy=delete
        )
    else:
        controller.update_prod_environment_check(
            status=GithubCheckStatus.COMPLETED, conclusion=GithubCheckConclusion.SKIPPED
        )