From 1427277e6c0119f8f041a6d06d559127ae83be67 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 18 Oct 2023 11:53:18 -0400 Subject: [PATCH] add changelog and workflow to test for entries --- .github/workflows/changelog.yml | 26 ++++++++++++++++++++++++++ CHANGES.rst | 4 ++++ 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/changelog.yml create mode 100644 CHANGES.rst diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000..9e949e0 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,26 @@ +name: Changelog + +on: + pull_request: + 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 + runs-on: ubuntu-latest + steps: + - name: Checkout code + 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') }} diff --git a/CHANGES.rst b/CHANGES.rst new file mode 100644 index 0000000..a4e38a7 --- /dev/null +++ b/CHANGES.rst @@ -0,0 +1,4 @@ +0.0.4 (unreleased) +------------------ + +- added changelog [#36]