From 9437aa8796c5f6c5244bab661a5e511fe79ad474 Mon Sep 17 00:00:00 2001 From: Gavin Inglis Date: Tue, 28 Jul 2026 21:19:28 +0000 Subject: [PATCH] ci: add changelog enforcement workflow Add a GitHub Actions workflow that checks PRs for CHANGELOG.md updates. The check can be skipped by applying the "skip-changelog" label to the PR, which re-triggers the workflow without requiring a re-push. Signed-off-by: Gavin Inglis --- .github/workflows/changelog.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/changelog.yml diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 00000000000..245b963edcf --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,21 @@ +name: changelog +on: + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] + +jobs: + changelog: + # Escape hatch: add the "skip-changelog" label to the PR. Re-runs on label change, + # so no re-push needed. + if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changelog') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: { fetch-depth: 0 } + - name: CHANGELOG.md must be updated + env: + BASE_REF: ${{ github.base_ref }} + run: | + git diff --name-only "origin/${BASE_REF}...HEAD" \ + | grep -qx 'CHANGELOG.md' \ + || { echo '::error file=CHANGELOG.md::PR does not touch CHANGELOG.md. Add an entry, or apply the "skip-changelog" label if this change needs none.'; exit 1; }