$ show tiangolo/latest-changes
This repository provides a deprecated GitHub Action that automatically updates release notes (Markdown files) with new entries from merged pull requests. It is a Docker-based action that runs on `pull_request_target` or `workflow_dispatch` events, fetches PR details via the GitHub API using PyGithub, and modifies a `release-notes.md` file by inserting a templated message under a configurable header. The core logic includes support for label-based sections, custom Jinja2 templates, skip labels, and retry logic for race conditions during git push. The codebase also includes a companion CLI tool (`scripts/prepare_release.py`) for automating version bumps and release note preparation. The action has been deprecated by the maintainer in favor of a dedicated GitHub App, but the code remains functional and well-maintained.
The LLM identified 1 files worth highlighting for reuse:
The `generate_content` function is the core engine for inserting new release entries into a Markdown file. It uses regex to locate the latest changes header, splits the content into sections based on label headers, and inserts the new PR entry under the correct section (or as standalone). It handles edge cases like no existing sections, custom headers, duplicate detection, and preserving content before/after the release section. This function is self-contained (imports only its own module) and could be extracted and reused in any project that needs to maintain a structured changelog or release notes file with labeled sections.