























@@ -3,6 +3,8 @@ name: ClawSweeper Dispatch
33on:
44issues:
55types: [opened, reopened, edited, labeled, unlabeled]
6+push:
7+branches: [main]
68pull_request_target: # zizmor: ignore[dangerous-triggers] maintainer-owned external dispatch; no checkout or untrusted PR code execution
79types: [opened, reopened, synchronize, ready_for_review, edited, labeled, unlabeled]
810@@ -37,6 +39,7 @@ jobs:
3739repositories: clawsweeper
38403941 - name: Dispatch exact ClawSweeper review
42+if: ${{ github.event_name != 'push' }}
4043env:
4144GH_TOKEN: ${{ steps.token.outputs.token || secrets.OPENCLAW_GH_TOKEN }}
4245TARGET_REPO: ${{ github.repository }}
@@ -64,3 +67,30 @@ jobs:
6467 else
6568 echo "::warning::Skipping ClawSweeper dispatch because the configured credential could not dispatch to openclaw/clawsweeper."
6669 fi
70+71+ - name: Dispatch ClawSweeper commit review
72+if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.deleted != true }}
73+env:
74+GH_TOKEN: ${{ steps.token.outputs.token || secrets.OPENCLAW_GH_TOKEN }}
75+TARGET_REPO: ${{ github.repository }}
76+BEFORE_SHA: ${{ github.event.before }}
77+AFTER_SHA: ${{ github.sha }}
78+SOURCE_REF: ${{ github.ref }}
79+run: |
80+ if [ -z "$GH_TOKEN" ]; then
81+ echo "::notice::Skipping ClawSweeper commit dispatch because no dispatch credential is configured."
82+ exit 0
83+ fi
84+ payload="$(jq -nc \
85+ --arg target_repo "$TARGET_REPO" \
86+ --arg before_sha "$BEFORE_SHA" \
87+ --arg after_sha "$AFTER_SHA" \
88+ --arg ref "$SOURCE_REF" \
89+ '{event_type:"clawsweeper_commit_review",client_payload:{target_repo:$target_repo,before_sha:$before_sha,after_sha:$after_sha,ref:$ref,enabled:true,create_checks:true}}')"
90+ if gh api repos/openclaw/clawsweeper/dispatches \
91+ --method POST \
92+ --input - <<< "$payload"; then
93+ echo "Dispatched ClawSweeper commit review."
94+ else
95+ echo "::warning::Skipping ClawSweeper commit dispatch because the configured credential could not dispatch to openclaw/clawsweeper."
96+ fi
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。