From e257e61dcbc3ad90eaa46d5c136f6056e308a692 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 21 Sep 2026 09:48:53 -0400 Subject: [PATCH 1/3] ci: adds a workflow to check whether the changelog has been edited --- .github/workflows/changelog-pr-guard.yml | 59 ++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/changelog-pr-guard.yml diff --git a/.github/workflows/changelog-pr-guard.yml b/.github/workflows/changelog-pr-guard.yml new file mode 100644 index 00000000..b79f359a --- /dev/null +++ b/.github/workflows/changelog-pr-guard.yml @@ -0,0 +1,59 @@ +name: Changelog PR Guard + +on: + pull_request_target: + branches: [ "main" ] + types: [ opened, synchronize, reopened, ready_for_review ] + +permissions: + contents: read + issues: write + pull-requests: read + +jobs: + check-changelog: + runs-on: ubuntu-latest + steps: + - name: Check for changelog changes + env: + GH_TOKEN: ${{ github.token }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPOSITORY: ${{ github.repository }} + run: | + changed_changelog_files="$( + gh api --paginate "repos/${REPOSITORY}/pulls/${PR_NUMBER}/files" \ + --jq '.[] | select(.filename | test("(^|/)CHANGELOG\\.md$"; "i")) | .filename' + )" + + if [ -z "${changed_changelog_files}" ]; then + echo "No changelog changes found." + exit 0 + fi + + comment_body="$(cat <<'EOF' + + The changelog is automatically generated through conventional commits, so this change must be reverted. + EOF + )" + + existing_comment_id="$( + gh api --paginate "repos/${REPOSITORY}/issues/${PR_NUMBER}/comments" \ + --jq '.[] | select(.user.login == "github-actions[bot]" and (.body | contains(""))) | .id' \ + | head -n 1 + )" + + if [ -n "${existing_comment_id}" ]; then + gh api \ + --method PATCH \ + "repos/${REPOSITORY}/issues/comments/${existing_comment_id}" \ + --field body="${comment_body}" > /dev/null + else + gh api \ + --method POST \ + "repos/${REPOSITORY}/issues/${PR_NUMBER}/comments" \ + --field body="${comment_body}" > /dev/null + fi + + echo "Changelog changes must be reverted:" + echo "${changed_changelog_files}" + exit 1 From f0f06367ad40277d52ee82d42aa17e4b540caaf6 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 21 Sep 2026 09:50:03 -0400 Subject: [PATCH 2/3] docs: updates the contributing information for the changelog --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a9d7b55..4d74e6c9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,6 +23,8 @@ The best way to get started with a contribution is to start a dialog with the ow Feel free to submit a pull request with a linked issue against the __main__ branch. The main branch will be updated frequently. +The changelog is generated automatically as part of the release process, so pull requests should not include updates to `CHANGELOG.md`. + ## Commit message format To support our automated release process, pull requests are required to follow the [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) From 862c34dd05bfae0163510043a83d83e49651515e Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 21 Sep 2026 09:51:52 -0400 Subject: [PATCH 3/3] ci: skips release please bot --- .github/workflows/changelog-pr-guard.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/changelog-pr-guard.yml b/.github/workflows/changelog-pr-guard.yml index b79f359a..ede1c434 100644 --- a/.github/workflows/changelog-pr-guard.yml +++ b/.github/workflows/changelog-pr-guard.yml @@ -12,6 +12,7 @@ permissions: jobs: check-changelog: + if: github.event.pull_request.user.login != 'release-please-token-provider[bot]' runs-on: ubuntu-latest steps: - name: Check for changelog changes