repomatic.github.release_sync module¶
Sync GitHub release notes from changelog.md.
Compares each GitHub release body against the corresponding
changelog.md section and updates any that have drifted.
changelog.md is the single source of truth.
- repomatic.github.release_sync.build_expected_body(changelog, version, *, admonition_override=None)[source]¶
Build the expected release body from the changelog.
Decomposes the changelog section into discrete elements and renders them through the
github-releasestemplate. This allows the GitHub release body to include a different subset of elements than therelease-notestemplate used forchangelog.mdentries.Lives here, with the release publishers, rather than in
repomatic.changelog: every caller is a GitHub-release writer (this sync, the dev pre-release, the release-notes metadata keys), and the changelog module renders changelog entries, not release bodies.- Parameters:
- Return type:
- Returns:
The rendered release body, or empty string if the version has no changelog section.
- class repomatic.github.release_sync.SyncRow(action, version, release_url)[source]¶
Bases:
objectPer-release detail for the markdown report table.
- action: ReportAction¶
- class repomatic.github.release_sync.SyncResult(dry_run=True, rows=<factory>, total=0, in_sync=0, drifted=0, updated=0, failed=0, missing_changelog=0)[source]¶
Bases:
objectAccumulated results from a release-notes sync run.
- repomatic.github.release_sync.sync_github_releases(repo_url, changelog_path, dry_run=True)[source]¶
Sync GitHub release bodies from
changelog.md.For each released version in the changelog, compares the expected body (from
changelog.md) with the actual GitHub release body. In live mode, updates drifted releases viagh release edit.- Parameters:
- Return type:
- Returns:
Structured sync results.
- repomatic.github.release_sync.render_sync_report(result)[source]¶
Render a markdown report from sync results.
- Parameters:
result (
SyncResult) – Structured results from the sync run.- Return type:
- Returns:
Markdown report string.