Feat/ccr reverse stats #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Changelog Guard | |
| # CHANGELOG.md is generated by release-please from Conventional Commit titles | |
| # (see .release-please-config.json). Hand-editing it makes every concurrent PR | |
| # conflict on the same `## Unreleased` lines — the "changelog cascade" where one | |
| # merge turns the rest DIRTY. `.gitattributes merge=union` does not help because | |
| # GitHub squash-merge ignores merge drivers. So the fix is to stop hand-edits at | |
| # the source: this guard fails any PR that touches CHANGELOG.md, except | |
| # release-please's own release PR (the one place it is meant to change). | |
| # | |
| # ponytail: uses the preinstalled gh CLI, no third-party action to pin. If a | |
| # rare PR legitimately must edit CHANGELOG.md, a maintainer can merge past this | |
| # non-required check; add a label-based exemption only if that ever recurs. | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| no-manual-changelog: | |
| # release-please's release PR is the sole author of CHANGELOG.md. | |
| if: ${{ !startsWith(github.head_ref, 'release-please--') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Reject manual CHANGELOG.md edits | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if gh pr view "${{ github.event.pull_request.number }}" \ | |
| --repo "${{ github.repository }}" \ | |
| --json files --jq '.files[].path' | grep -qx 'CHANGELOG.md'; then | |
| echo "::error::Do not edit CHANGELOG.md by hand. release-please generates it from your Conventional Commit PR title (e.g. 'fix(proxy): ...'). Remove the CHANGELOG.md change — your entry appears automatically in the next release PR." | |
| exit 1 | |
| fi | |
| echo "OK — CHANGELOG.md not modified." |