Skip to main content

Sphinx Github Changelog: Build a sphinx changelog from GitHub Releases

Deployed to PyPI Deployed to PyPI GitHub Repository Continuous Integration Documentation Coverage MIT License Contributor Covenant

Sphinx-github-changelog is a Sphinx plugin that builds a changelog section based on a repository’s GitHub Releases content.

How ? (the short version)

In your Sphinx documentation conf.py:

extensions = [
    ...,  # your other extensions
    "sphinx_github_changelog",
]

In your documentation:

.. changelog::
    :changelog-url: https://your-project.readthedocs.io/en/stable/#changelog
    :github: https://github.com/you/your-project/releases/
    :pypi: https://pypi.org/project/your-project/

or more minimally (but not necessarily recommended):

.. changelog::

See the end result for this project on ReadTheDocs.

Why ?

On the way to continuous delivery, it’s important to be able to release easily. One of the criteria for easy releases is that the release doesn’t require a commit and a Pull Request. Release Pull Requests usually include 2 parts:

  • Changing the version

  • Updating the changelog (if you keep a changelog, let’s assume you do)

Commitless releases need a way to store the version and the changelog, as close as possible to the code, but actually not in the code.

Setting aside the “version” question, sphinx-github-changelog aims at providing a good way of managing the “changelog” part:

The best solution we’ve found so far for the changelog is to store it in the body of GitHub Releases. That’s very practical for maintainers, but it may not be the first place people will look for it. As far as we’ve seen, people expect the changelog to be:

  • in the repo, in CHANGELOG.rst,

  • in the built documentation.

Having the changelog in CHANGELOG.rst causes a few problems:

  • Either each PR adds its single line of changelog, but:

    • you’ll most probably run into countless merge conflicts,

    • the changelog won’t tell you which contribution was part of which release

    This reduces the interest for the whole thing.

  • Or your changelog is edited at release time. Maybe you’re using towncrier for fragment-based changelog, but you’re not doing commitless releases anymore. You could imagine that the release commit is done by your CI, but this can quickly become annoying, especially if you require Pull Requests.

But there is another way. Instead of providing the changelog, the CHANGELOG.rst file can hold a link to the changelog. This makes things much easier. sphinx-github-changelog encourages you to do that.

Reference documentation

Automatic Configuration

The extension can automatically detect the GitHub repository URL from your git remotes in this order:

  1. upstream remote

  2. origin remote

The GitHub API base URL and GitHub root URL are derived from this URL.

If for any reason, you’d rather provide the repository explicitly (e.g. the doc repo doesn’t match the repo you’re releasing from, or anything else), you can define the :github: attribute to the directive. See directive for details.

Authentication

The extension uses the GitHub Releases REST API to retrieve the changelog.

For public repositories, this can usually work without authentication, though it’s not recommended as GitHub applies IP-based rate limits, so this may make your builds flaky. Note that there will be automatic retries after HTTP 429 responses, controlled by the sphinx_github_changelog_retries option (see below). For private repositories (or when unauthenticated requests are rate limited), you need a GitHub API token.

Tokens can be read from (in this order):

  • sphinx_github_changelog_token in conf.py (please do NOT commit your secrets)

  • SPHINX_GITHUB_CHANGELOG_TOKEN environment variable

  • GITHUB_TOKEN environment variable

  • Your git configuration, using git’s credential system

  • The gh command, using the auth token command

When using GitHub Actions, you can pass a token explicitly as an environment variable:

- name: Build documentation
  run: make html
  env:
    SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ github.token }}

If you’re not in one of the cases above and your build environment cannot use anonymous API access reliably (e.g. rate limits), you’ll need a personal access token. If the repository is public, the token doesn’t need any special access (you can uncheck everything). For private and internal repositories, the token must have repo scope (classic tokens) or contents: read access (fine-grained tokens).

Pass the token as the SPHINX_GITHUB_CHANGELOG_TOKEN (or GITHUB_TOKEN) environment variable. You can also set the token as sphinx_github_changelog_token in conf.py, but you should never commit secrets such as this.

Extension options (conf.py)

All options can also be set via environment variables of the same name in uppercase (e.g. SPHINX_GITHUB_CHANGELOG_TOKEN).

Option

Default

Description

sphinx_github_changelog_token

None

GitHub API token. See above (please do NOT commit your secrets).

sphinx_github_changelog_root_repo

None

Root URL to the repository. Usually detected automatically.

sphinx_github_changelog_include_prereleases

True

Whether to include pre-releases in the changelog. Set to False to exclude them (env var accepts 0, false, no).

sphinx_github_changelog_retries

3

Number of retries after HTTP 429 responses from GitHub API. Will wait exponentially longer between each retry, starting at 5 second.

Directive

.. changelog::
    :changelog-url: https://your-project.readthedocs.io/en/stable/changelog.html
    :github: https://github.com/you/your-project/releases/
    :pypi: https://pypi.org/project/your-project/

Attributes

  • github (optional): URL to the releases page of the repository. If not provided, auto-detected from your git remote, as described above.

  • changelog-url (optional): URL to the built version of your changelog. sphinx-github-changelog will display a link to your built changelog if the GitHub token is not provided (hopefully, this does not happen in your built documentation)

  • pypi (optional): URL to the PyPI page of the repository. This allows the changelog to display links to each PyPI release.

You’ll notice that each parameter here is not requested in the simplest form but as very specific URLs from which the program extracts the needed information. This is done on purpose. If people browse the unbuilt version of your documentation (e.g. on GitHub or PyPI directly), they’ll still be presented with links to the pages that contain the information they will need, instead of unhelping directives.

Check out the built version!

This Readme is also built as a Sphinx documentation, and it includes the changelog. Interested to see how it looks? Check it out on our ReadTheDocs space.

If you encounter a bug, or want to get in touch, you’re always welcome to open a ticket.

Metadata

Release files for sphinx-github-changelog 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-github-changelog 2.3.0
File Size Uploaded
sphinx_github_changelog-2.3.0.tar.gz 84.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-github-changelog 2.3.0
File Interpreter ABI Platform
sphinx_github_changelog-2.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 99.0 kB

Release files / sphinx_github_changelog-2.3.0.tar.gz

Download URL sphinx_github_changelog-2.3.0.tar.gz
Size 84.8 kB
Tags Source
SHA-256 checksum
How to use checksums
704a6dfca5426b70b0bbcfb426937cb900935a69c0343690af8602bd50d100f8
BLAKE2b-256 checksum
How to use checksums
e6f0806d02d9a28a5a36ce7bb01dd38ca086e50d2732615435276dbdd2333657
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / sphinx_github_changelog-2.3.0-py3-none-any.whl

Download URL sphinx_github_changelog-2.3.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f4d2ffe2dd4dc0c8980b1bc3fbfced5454c9224d15a4b367ebee6c14e5edd5f
BLAKE2b-256 checksum
How to use checksums
d53a961b4ebaaed1ef8d4df52d9dc376c540cc22c5bb6c9f1c09f2d735e04665
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

1 release file

1.0.1

1 release file

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page