scripts.release.release_notes ============================= .. py:module:: scripts.release.release_notes .. autoapi-nested-parse:: Render Markdown release notes from the commits between two git refs. Usage: uv run python -m scripts.release.release_notes [] Used by the ``release`` job in ``.github/workflows/ci.yml``: every push to main builds ``ghcr.io/rewake-fr/api:sha-`` and publishes a GitHub Release with that same tag, whose notes are this script's output for ``..HEAD``. Without a previous tag (the very first release) only the last ``FIRST_RELEASE_MAX_COMMITS`` commits are listed. Commits are grouped by their Conventional Commits type (``feat(pdf): ...`` -> "Nouveautés", scope shown in bold); anything unprefixed lands in "Autres changements". A ``type!:`` subject or a ``BREAKING CHANGE:`` footer is also listed under "Changements cassants", with the footer's text -- that's where an operator learns about e.g. a removed environment variable before deploying. Merge commits are skipped. Any ``@word`` in commit text is wrapped in backticks: GitHub turns a bare ``@page`` (a CSS at-rule in a real commit subject here) into a mention of the GitHub user "page" and lists them as a release contributor. Attributes ---------- .. autoapisummary:: scripts.release.release_notes.IMAGE scripts.release.release_notes.FIRST_RELEASE_MAX_COMMITS scripts.release.release_notes.SECTIONS Classes ------- .. autoapisummary:: scripts.release.release_notes.Commit Functions --------- .. autoapisummary:: scripts.release.release_notes.parse_commit scripts.release.release_notes.render scripts.release.release_notes.read_commits scripts.release.release_notes.main Module Contents --------------- .. py:data:: IMAGE :value: 'ghcr.io/rewake-fr/api' .. py:data:: FIRST_RELEASE_MAX_COMMITS :value: 30 .. py:data:: SECTIONS :type: list[tuple[str, str]] :value: [('feat', 'Nouveautés'), ('fix', 'Corrections'), ('perf', 'Performances'), ('refactor',... .. py:class:: Commit .. py:attribute:: sha :type: str .. py:attribute:: type :type: str .. py:attribute:: scope :type: str | None .. py:attribute:: text :type: str .. py:attribute:: breaking :type: str | None .. py:function:: parse_commit(sha: str, subject: str, body: str) -> Commit .. py:function:: render(commits: collections.abc.Sequence[Commit], tag: str, previous_tag: str | None, repository: str | None = None) -> str .. py:function:: read_commits(previous_tag: str | None) -> list[Commit] .. py:function:: main(argv: collections.abc.Sequence[str] | None = None) -> int