Skip to content

Extract review-dispatch (PR_BRANCH resolution + fork-aware --ref) into a shared composite action #419

Description

@d-morrison

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions