def METHOD_NAME(ctx, from_ref, to_ref, release_milestone, exclude_releases, export_csv):
    agent_release = Release.from_github(ctx, 'datadog-agent', release_milestone, from_ref=from_ref, to_ref=to_ref)
    integrations_release = Release.from_github(
        ctx, 'integrations-core', release_milestone, from_ref=from_ref, to_ref=to_ref
    )
    changes = [parse_commit(commit) for commit in agent_release.commits + integrations_release.commits]
    if exclude_releases:
        filtered_changes = []
        for change in changes:
            title = change['title'].lower()
            if not title.startswith('[release]') and not title.startswith('release'):
                filtered_changes.append(change)
        changes = filtered_changes
    changes = sorted(changes, key=lambda x: x['next_tag'])  # sort by RC
    if export_csv:
        export_changes_as_csv(changes, export_csv)
    for change in changes:
        print(','.join([change[field] for field in ['url', 'teams', 'next_tag', 'title']]))