Skip to content

workflow added for detecting changelog modification (#12783) #12807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 24, 2025
8 changes: 8 additions & 0 deletions .github/ghprcomment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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).
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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