Skip to content

Commit

Permalink
Merge pull request #1826 from zacharyburnett/changelog/towncrier
Browse files Browse the repository at this point in the history
handle changelog entries with `towncrier`
  • Loading branch information
braingram authored Aug 19, 2024
2 parents dbbc26f + b8e791c commit 229269a
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 85 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ If this PR fixes an issue, please add closing keywords (eg 'fixes #XXX')

- [ ] pre-commit checks ran successfully
- [ ] tests ran successfully
- [ ] for a public change, a changelog entry was added
- [ ] for a public change, documentation was updated
- [ ] for a public change, added news fragment (`changes/<PR#>.<changetype>.rst`)
- [ ] for a public change, updated documentation
- [ ] for any new features, unit tests were added
30 changes: 17 additions & 13 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
name: Changelog
name: changelog

on:
pull_request:
types: [labeled, unlabeled, opened, synchronize, reopened]
types:
- labeled
- unlabeled
- opened
- synchronize
- reopened

# Only cancel in-progress jobs or runs for the current workflow
# This cancels the already triggered workflows for a specific PR without canceling
# other instances of this workflow (other PRs, scheduled triggers, etc) when something
# within that PR re-triggers this CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
changelog:
name: Confirm changelog entry
check:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-entry-needed') }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Grep for PR number in CHANGES.rst
run: grep -P '\[[^\]]*#${{github.event.number}}[,\]]' CHANGES.rst
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-entry-needed') }}
- run: pip install .
- run: pip install towncrier
- run: towncrier check
- run: towncrier build --draft | grep -P '[\(\[][^\)\]]*#${{ github.event.number }}[,\)\]]'
2 changes: 2 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ build:
- git fetch --all --tags || true
pre_install:
- git update-index --assume-unchanged docs/rtd_environment.yaml docs/conf.py
post_install:
- towncrier build

conda:
environment: docs/rtd_environment.yaml
Expand Down
Loading

0 comments on commit 229269a

Please sign in to comment.