From c2e934a8e888c818c02c448b4f1931a451b931c9 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Tue, 10 Sep 2024 11:34:37 -0400 Subject: [PATCH] check changelog with towncrier --- .github/workflows/changelog.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index ebedec18..cb5c44f4 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,16 +1,30 @@ -name: Ensure changelog +name: changelog on: pull_request: - types: [labeled, unlabeled, opened, synchronize, reopened] + types: + - labeled + - unlabeled + - opened + - synchronize + - reopened + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: - ensure_changelog: - name: Verify that a changelog entry exists for this pull request + check: + if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-entry-needed') }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/setup-python@v5 + with: + python-version: 3 + - uses: actions/checkout@v4 with: - submodules: true - - run: grep -P '\[[^\]]*#${{github.event.number}}[,\]]' CHANGES.rst - if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-entry-needed') }} + fetch-depth: 0 + - run: pip install . + - run: pip install towncrier + - run: towncrier check + - run: towncrier build --draft | grep -P '#${{ github.event.number }}'