From 58e1b587b08a530c3bbadfb9be6cd7100bc29b2c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 16 Oct 2026 12:23:47 -0700 Subject: [PATCH] fix: ignore maintainer opt-in reminder commands Co-authored-by: Sebastien Tardif --- .github/workflows/clawsweeper-dispatch.yml | 4 + CHANGELOG.md | 2 + README.md | 4 +- tests/comment-prefilter.test.mjs | 85 ++++++++++++++++++++++ 4 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 tests/comment-prefilter.test.mjs diff --git a/.github/workflows/clawsweeper-dispatch.yml b/.github/workflows/clawsweeper-dispatch.yml index 569d5c0..7d23d2d 100644 --- a/.github/workflows/clawsweeper-dispatch.yml +++ b/.github/workflows/clawsweeper-dispatch.yml @@ -46,6 +46,10 @@ jobs: COMMENT_BODY: ${{ github.event.comment.body }} run: | set -euo pipefail + if [[ "$COMMENT_BODY" == *"', + 'ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment `@clawsweeper review`.', + '/review', + ].join('\n'); + assert.equal(classify(body), 'is_command=false'); +}); + +test('ordinary comments and lookalike words do not route', () => { + assert.equal(classify('thanks for the patch\n'), 'is_command=false'); + assert.equal(classify('please /preview the page\n'), 'is_command=false'); + assert.equal(classify('please /stopwatch the build\n'), 'is_command=false'); +});