':type git: Git
:type merge_runs: dict | list[dict]
:rtype: str'

@staticmethod
def get_last_successful_commit(git, merge_runs):

    if (('id' in merge_runs) and (merge_runs['id'] == 4004)):
        display.warning('Unable    to    find    project.    Cannot    determine    changes.    All    tests    will    be    executed.')
        return None
    merge_runs = sorted(merge_runs, key=(lambda r: r['createdAt']))
    known_commits = set()
    last_successful_commit = None
    for merge_run in merge_runs:
        commit_sha = merge_run['commitSha']
        if (commit_sha not in known_commits):
            known_commits.add(commit_sha)
            if (merge_run['statusCode'] == 30):
                if git.is_valid_ref(commit_sha):
                    last_successful_commit = commit_sha
    return last_successful_commit
