Check for changelog entries in pull requests
ADD
.github/workflows/changelog.yml
+name: Check
+
+on:
+ pull_request:
+ types: [labeled, unlabeled, opened, reopened, synchronize]
+
+jobs:
+ check-changelog-entry:
+ name: changelog entry
+ runs-on: ubuntu-20.04
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ # `towncrier check` runs `git diff --name-only origin/main...`, which
+ # needs a non-shallow clone.
+ fetch-depth: 0
+
+ - name: Check changelog
+ if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')"
+ run: |
+ if ! pipx run towncrier check --compare-with origin/${{ github.base_ref }}; then
+ echo "Please see https://github.com/urllib3/urllib3/blob/main/changelog/README.rst for guidance."
+ false
+ fi

MODIFY
changelog/README.rst
changelog/README.rst
-This directory contains "newsfragments" which are short files that contain a small
+This directory contains changelog entries: short files that contain a small
**ReST**-formatted text that will be added to ``CHANGES.rst`` by `towncrier
<https://towncrier.readthedocs.io/en/actual-freaking-docs/>`__.
-The ``CHANGELOG`` will be read by **users**, so this description should be aimed to
+The ``CHANGES.rst`` will be read by **users**, so this description should be aimed to
urllib3 users instead of describing internal changes which are only relevant to the
developers.
@@ -22,6 +22,9 @@ If your pull request fixes an issue, use that number here. If there is no issue,
after you submit the pull request and get the pull request number you can add a
changelog using that instead.
+If your change does not deserve a changelog entry, apply the `Skip Changelog` GitHub
+label to your pull request.
+
You can also run ``nox -s docs`` to build the documentation with the draft changelog
(``docs/_build/html/changelog.html``) if you want to get a preview of how your change
will look in the final release notes. You can also see a preview from the Read the Docs

Check for changelog entries in pull requests