Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/scripts/check_changelog_release_only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ if [[ -z "${HEAD_REF:-}" ]]; then
exit 1
fi

if [[ -z "${BASE_SHA:-}" ]]; then
echo "Error: BASE_SHA environment variable is not set"
if [[ -z "${BASE_REF:-}" ]]; then
echo "Error: BASE_REF environment variable is not set"
exit 1
fi

changed_files=$(git diff --no-renames --name-only "${BASE_SHA}"...HEAD)
if [[ -z "${PR_HEAD_SHA:-}" ]]; then
echo "Error: PR_HEAD_SHA environment variable is not set"
exit 1
fi

changed_files=$(git diff --no-renames --name-only "origin/${BASE_REF}...${PR_HEAD_SHA}")

touches_changelog=false
if grep -qx 'CHANGELOG.md' <<< "${changed_files}"; then
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ jobs:
if: github.event_name == 'pull_request'
env:
HEAD_REF: ${{ github.head_ref }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: .github/scripts/check_changelog_release_only.sh

- name: Validate changelog fragment schema
Expand Down
Loading