diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 42cd8169b2..ef49ba5ad3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,6 +6,19 @@ Fixes #X. ## To Do -- [ ] Documentation. (If you've add a new command-line flag, for example, find the appropriate page under `docs/` to describe it.) -- [ ] Changelog. (Add an entry to `docs/changelog.rst` near the top of the document.) -- [ ] Tests. (Encouraged but not strictly required.) + + +- [ ] Documentation. (If you've added a new command-line flag, for example, find the appropriate page under `docs/` to describe it.) +- [ ] Changelog. (Add an entry to `docs/changelog.rst` to the bottom of one of the lists near the top of the document.) +- [ ] Tests. (Very much encouraged but not strictly required.) diff --git a/.github/workflows/changelog_reminder.yaml b/.github/workflows/changelog_reminder.yaml new file mode 100644 index 0000000000..48b0f1d9a3 --- /dev/null +++ b/.github/workflows/changelog_reminder.yaml @@ -0,0 +1,33 @@ +name: Verify changelog updated + +on: + pull_request: + types: + - opened + - ready_for_review + + +jobs: + check_changes: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get changed files + id: getfile + run: | + echo "Files changed:" + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}) + echo "$CHANGED_FILES" + echo "CHANGED_FILES<> $GITHUB_ENV + echo "$CHANGED_FILES" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Comment PR + uses: thollander/actions-comment-pull-request@v2 + with: + message: 'Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.' + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + if: contains(env.CHANGED_FILES, '.py') && !contains(env.CHANGED_FILES, 'changelog.rst')