diff --git a/.github/ghprcomment.yml b/.github/ghprcomment.yml index 0ee5bc59be2..513453a6748 100644 --- a/.github/ghprcomment.yml +++ b/.github/ghprcomment.yml @@ -114,3 +114,11 @@ You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section [Final build system checks](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-12-build.html#final-build-system-checks) in our setup guide. +- jobName: 'CHANGELOG.md needs to be modified' + message: > + You ticked that you modified `CHANGELOG.md`, but no new entry was found there. + + + If you made changes that are visible to the user, please add a brief description along with the issue number to the `CHANGELOG.md` file. + If you did not, please replace the cross (`[x]`) by a slash (`[/]`) to indicate that no `CHANGELOG.md` entry is necessary. + More details can be found in our [Developer Documentation about the changelog](https://devdocs.jabref.org/decisions/0007-human-readable-changelog.html). diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 258c5e67108..591d9528789 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -487,3 +487,38 @@ jobs: with: name: pr_number path: pr_number.txt + + changelog_modified: + name: CHANGELOG.md needs to be modified + if: github.actor != 'dependabot[bot]' && github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check PR body for changelog note + id: changelog_check + run: | + BODY=$(gh pr view "${{ github.event.number }}" --json body --template '{{.body}}') + echo "Body: $BODY" + + if echo "$BODY" | grep -q '\- \[x\] Change in `CHANGELOG.md`'; then + echo "found" + echo "found=yes" >> $GITHUB_OUTPUT + else + echo "not found" + echo "found=no" >> $GITHUB_OUTPUT + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Check for CHANGELOG.md modifications + id: check_changelog_modification + if: steps.changelog_check.outputs.found == 'yes' + run: | + git fetch origin ${{ github.base_ref }} + if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q '^CHANGELOG\.md$'; then + echo "✅ CHANGELOG.md was modified" + else + echo "❌ CHANGELOG.md was NOT modified" + exit 1 + fi