From 373ddcaca89db36196619ee22a29d61b3f39aee3 Mon Sep 17 00:00:00 2001 From: Paul Payne Date: Thu, 2 Jul 2026 03:42:04 -0700 Subject: [PATCH] ci: reject PRs that reference the assistant by name in title/body/commits Server-side counterpart to the global commit-msg hook (which blocks the same word locally, but can be bypassed with --no-verify or via GitHub UI edits). Checks only message text, never file contents. --- .github/workflows/no-claude.yml | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/no-claude.yml diff --git a/.github/workflows/no-claude.yml b/.github/workflows/no-claude.yml new file mode 100644 index 0000000..58fcaa9 --- /dev/null +++ b/.github/workflows/no-claude.yml @@ -0,0 +1,41 @@ +name: No Claude references + +# Server-side counterpart to the global commit-msg hook: rejects a PR whose +# title, body, or commit messages mention "claude" (any case). Catches commits +# pushed with --no-verify and edits made in the GitHub UI. Only message text is +# checked — never file contents, since the code legitimately references claude. + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + +permissions: + contents: read + +jobs: + no-claude: + runs-on: ubuntu-latest + steps: + - name: Check PR title and body + env: + TITLE: ${{ github.event.pull_request.title }} + BODY: ${{ github.event.pull_request.body }} + run: | + if printf '%s\n%s' "$TITLE" "$BODY" | grep -qi 'claude'; then + echo "::error::PR title or body mentions 'claude' — please remove it." + exit 1 + fi + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check commit messages + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: | + if git log --format='%B' "$BASE_SHA..$HEAD_SHA" | grep -qi 'claude'; then + echo "::error::A commit message in this PR mentions 'claude'." + exit 1 + fi