Problem
action.yml (root) and .github/actions/install-fullsend-cli/action.yml duplicate several blocks of install logic verbatim:
- OS/arch normalization (runner values to Go release conventions) -- identical 11-line block in both files
- SHA-to-tag resolution -- same goal, different implementations (
curl + manual pagination vs gh api --paginate)
retry_curl -- defined twice within action.yml itself (detect step and download step)
- Source-build clone -- nearly identical shallow-fetch-with-full-clone-fallback pattern
This duplication has already caused the same bug to be patched in both places independently (the jq-injection fix in the SHA-to-tag resolution was one bug fixed twice in a prior review round of #5357).
Proposal
Create .github/scripts/fullsend-install-lib.sh exporting shared functions:
retry_curl -- retry wrapper with exponential backoff
resolve_runner_platform -- normalize RUNNER_OS/RUNNER_ARCH to Go conventions
resolve_sha_to_tag -- look up a 40-char SHA in repo tags, return matching release tag
clone_at_ref -- shallow-clone with full-clone fallback for bare SHAs
Both action files source the library instead of inlining the logic.
Align the pagination approach
action.yml uses curl with a manual max_pages=50 cap (no stated rationale for the number), while install-fullsend-cli/action.yml uses gh api --paginate with no cap. The shared resolve_sha_to_tag function should pick one strategy -- either gh api --paginate (no manual cap) or a documented cap with a clear reason for the bound.
Resolve the tag once upstream instead of per-stage-job
The six stage workflows (reusable-code/fix/triage/review/retro/prioritize.yml) each call install-fullsend-cli independently with no cache, so every job/matrix branch re-runs the SHA-to-tag lookup for the same SHA. reusable-dispatch.yml already caches its CLI install via actions/cache keyed on fullsend-cli-${mode}-${job.workflow_sha}, but the stage workflows have no equivalent. Cheap today (66 tags, fits one page) but scales poorly if tag count or fan-out grows. When extracting the shared lib, consider resolving the tag once in a shared route job (or in reusable-dispatch.yml) and passing it down to stage jobs as an input.
Blocked by
Problem
action.yml(root) and.github/actions/install-fullsend-cli/action.ymlduplicate several blocks of install logic verbatim:curl+ manual pagination vsgh api --paginate)retry_curl-- defined twice withinaction.ymlitself (detect step and download step)This duplication has already caused the same bug to be patched in both places independently (the jq-injection fix in the SHA-to-tag resolution was one bug fixed twice in a prior review round of #5357).
Proposal
Create
.github/scripts/fullsend-install-lib.shexporting shared functions:retry_curl-- retry wrapper with exponential backoffresolve_runner_platform-- normalizeRUNNER_OS/RUNNER_ARCHto Go conventionsresolve_sha_to_tag-- look up a 40-char SHA in repo tags, return matching release tagclone_at_ref-- shallow-clone with full-clone fallback for bare SHAsBoth action files source the library instead of inlining the logic.
Align the pagination approach
action.ymlusescurlwith a manualmax_pages=50cap (no stated rationale for the number), whileinstall-fullsend-cli/action.ymlusesgh api --paginatewith no cap. The sharedresolve_sha_to_tagfunction should pick one strategy -- eithergh api --paginate(no manual cap) or a documented cap with a clear reason for the bound.Resolve the tag once upstream instead of per-stage-job
The six stage workflows (
reusable-code/fix/triage/review/retro/prioritize.yml) each callinstall-fullsend-cliindependently with no cache, so every job/matrix branch re-runs the SHA-to-tag lookup for the same SHA.reusable-dispatch.ymlalready caches its CLI install viaactions/cachekeyed onfullsend-cli-${mode}-${job.workflow_sha}, but the stage workflows have no equivalent. Cheap today (66 tags, fits one page) but scales poorly if tag count or fan-out grows. When extracting the shared lib, consider resolving the tag once in a shared route job (or inreusable-dispatch.yml) and passing it down to stage jobs as an input.Blocked by
continue-on-error+ source-build fallback to rootaction.yml, which changes the download step. This refactor should land after that PR to avoid merge conflicts.