diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index ef8f77c6..c8a84948 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -8,6 +8,32 @@ permissions: contents: read jobs: + changelog: + name: CHANGELOG updated + runs-on: ubuntu-latest + if: >- + github.event_name == 'pull_request' && + !contains(github.event.pull_request.labels.*.name, 'skip-changelog') + + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Verify CHANGELOG.md was updated + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: | + if git diff --name-only "$BASE_SHA...$HEAD_SHA" | grep -qx 'CHANGELOG.md'; then + echo "CHANGELOG.md was updated." + else + echo "::error::CHANGELOG.md was not updated in this PR." + echo "Add an entry to CHANGELOG.md, or apply the 'skip-changelog' label if this change does not warrant one." + exit 1 + fi + quality: name: Black, Pylint, and Mypy runs-on: ubuntu-latest