
Two workflows carry drifting copies of the same toolchain setup. Extract it into one local composite action with a defaulted input, a required input and an output the calling step reads back, and have both workflows call it with uses: ./. The shipped tool records the directory it ran from, which is the action's own directory inside a composite and empty in an inline step, so repeating the steps in each workflow does not pass.
Four drifting per-service pipelines become one reusable workflow with a workflow_call contract: a required string input, a defaulted number input, a required secret and an output that reaches the caller's summary job through needs. The shipped tool records which workflow it ran in, which inside a called workflow is the called workflow's name and not the caller's, so leaving the steps in the caller does not pass. One grading run withholds the signing secret to prove the packaging depends on it.
Assemble the library: one composite setup action, one reusable test-and-package workflow that calls it, and one caller invoking that workflow per service with explicit secrets, with both outputs feeding a summary job. The shipped tools record where they ran - the action's own directory inside a composite, and the called workflow's name inside a reusable workflow - so leaving either inline does not pass however identical the files. One grading run withholds a single service's secret to check the failure stays with that service.