claude.yml has three near-identical review-dispatch blocks (the trigger-comment dispatch, the late @claude review dispatch, and the post-push re-request), each doing: resolve PR_BRANCH (with the #418 GitHub-API fallback when Checkout PR branch was skipped), then gh workflow run $REVIEW_WF with a fork-aware --ref.
#418 made all three consistent by copying the block, but that leaves three copies of the same logic that can drift (the exact concern raised in #418's review). Per this repo's own review priority ("factor shared logic into reusable units rather than copying it between files"), extract this into a single composite action (e.g. .github/actions/dispatch-review/ wrapping scripts/dispatch-review.sh, resolved via github.action_path so it works for consumers via @v2), add an offline test suite (table of PR_BRANCH/head-repo/fallback cases), wire all three sites to it, and cover it in _selftest.yml — mirroring the report-push-failure / detect-review-request pattern.
Deferred from #418 (which completed the correctness sweep; this is the DRY follow-up).
claude.ymlhas three near-identical review-dispatch blocks (the trigger-comment dispatch, the late@claude reviewdispatch, and the post-push re-request), each doing: resolvePR_BRANCH(with the #418 GitHub-API fallback whenCheckout PR branchwas skipped), thengh workflow run $REVIEW_WFwith a fork-aware--ref.#418 made all three consistent by copying the block, but that leaves three copies of the same logic that can drift (the exact concern raised in #418's review). Per this repo's own review priority ("factor shared logic into reusable units rather than copying it between files"), extract this into a single composite action (e.g.
.github/actions/dispatch-review/wrappingscripts/dispatch-review.sh, resolved viagithub.action_pathso it works for consumers via@v2), add an offline test suite (table of PR_BRANCH/head-repo/fallback cases), wire all three sites to it, and cover it in_selftest.yml— mirroring thereport-push-failure/detect-review-requestpattern.Deferred from #418 (which completed the correctness sweep; this is the DRY follow-up).