From 23818600bb038a606c9d5add45342b2f6e212378 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 28 Apr 2026 06:43:38 +0100 Subject: [PATCH] ci: add ClawSweeper event dispatcher --- .github/workflows/clawsweeper-dispatch.yml | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/clawsweeper-dispatch.yml diff --git a/.github/workflows/clawsweeper-dispatch.yml b/.github/workflows/clawsweeper-dispatch.yml new file mode 100644 index 00000000000..67723cc6038 --- /dev/null +++ b/.github/workflows/clawsweeper-dispatch.yml @@ -0,0 +1,35 @@ +name: ClawSweeper Dispatch + +on: + issues: + types: [opened, reopened, edited, labeled, unlabeled] + pull_request_target: + types: [opened, reopened, synchronize, ready_for_review, edited, labeled, unlabeled] + +permissions: + contents: read + +jobs: + dispatch: + runs-on: ubuntu-latest + steps: + - name: Create ClawSweeper dispatch token + id: token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.CLAWSWEEPER_APP_ID }} + private-key: ${{ secrets.CLAWSWEEPER_APP_PRIVATE_KEY }} + owner: openclaw + repositories: clawsweeper + + - name: Dispatch exact ClawSweeper review + env: + GH_TOKEN: ${{ steps.token.outputs.token }} + TARGET_REPO: ${{ github.repository }} + ITEM_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }} + ITEM_KIND: ${{ github.event_name == 'pull_request_target' && 'pull_request' || 'issue' }} + run: | + gh api repos/openclaw/clawsweeper/dispatches \ + --method POST \ + --field event_type=clawsweeper_item \ + --raw-field client_payload="{\"target_repo\":\"$TARGET_REPO\",\"item_number\":$ITEM_NUMBER,\"item_kind\":\"$ITEM_KIND\"}"