Gist here

import click
import gitlab

@click.option('--token', prompt=True, help='Your GitLab personal access token.')
@click.option('--gitlab_url', default='', help='Your GitLab instance URL.')
@click.option('--mr_name', prompt=True, help='The name of the merge requests to approve.')
def approve_merge_requests(token, gitlab_url, mr_name):
    # Initialize GitLab client
    gl = gitlab.Gitlab(url=gitlab_url, private_token=token)

    # List all projects
    projects = gl.projects.list(all=True)
    for project in projects:
        # List merge requests for each project
        merge_requests = project.mergerequests.list(state='opened')
        click.echo(f"Merge requests for project {}:")
        for mr in merge_requests:
            click.echo(f"MR: {mr}")
            click.echo(f"Title: {mr.source_branch}")
            # Check if the merge request title matches the specified name
            if mr.source_branch == mr_name and != "lrs-service-amdocs":
                # Approve the merge request
                click.echo(f"Approved MR: {mr.title} in project {}")

if __name__ == '__main__':