Add check for CHANGELOG.md change when changelog label applied to PR (#33675)

* Add check for CHANGELOG.md change when changelog label applied to PR

* Update changelog
This commit is contained in:
Will Hickey 2023-10-20 11:01:52 -05:00 committed by GitHub
parent 59cb3b57ee
commit e5dfc9cb27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 0 deletions

10
.github/scripts/check-changelog.sh vendored Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
set -uo pipefail
CHANGELOG_FILE="CHANGELOG.md"
echo "Checking: git diff --exit-code origin/${BASE_REF} -- ${CHANGELOG_FILE}"
if git diff --exit-code "origin/${BASE_REF}" -- "${CHANGELOG_FILE}"; then
>&2 echo "Error: this pull request requires an entry in $CHANGELOG_FILE, but no entry was found"
exit 1
fi

20
.github/workflows/changelog-label.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: Require changelog entry
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
jobs:
check-changelog:
if: contains(github.event.pull_request.labels.*.name, 'changelog')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check if changes to CHANGELOG.md
shell: bash
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: .github/scripts/check-changelog.sh

View File

@ -14,6 +14,7 @@ Release channels have their own copy of this changelog:
<a name="edge-channel"></a>
## [1.18.0] - Unreleased
* Changes
* Added a github check to support `changelog` label
* Upgrade Notes
## [1.17.0]