Skip to content

Commit

Permalink
Add check for changelog entry in GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dermatz committed Aug 19, 2024
1 parent 97a2a08 commit 83e6ba8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/check-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:

- name: Check for changelog entry
run: |
if ! git diff --name-only HEAD^ HEAD | grep -q 'CHANGELOG.md'; then
BASE_BRANCH=$(jq -r .pull_request.base.ref < $GITHUB_EVENT_PATH)
MERGE_BASE=$(git merge-base HEAD $BASE_BRANCH)
if ! git diff --name-only $MERGE_BASE HEAD | grep -q 'CHANGELOG.md'; then
echo "No changelog entry found. Please add an entry to CHANGELOG.md."
exit 1
fi

0 comments on commit 83e6ba8

Please sign in to comment.