def METHOD_NAME(self, workflow_name, ref):
    """
    Gets latest workflow run for a given reference
    """
    workflow = self._repository.get_workflow(workflow_name)
    runs = workflow.get_runs(branch=ref)
    return max(runs, key=lambda run: run.created_at, default=None)