ENGINEERING NOTE
Reusable Delivery Workflows Are Contracts
Treat reusable CI workflows as stable interfaces with explicit permissions, inputs, and failure boundaries.
Reusable CI/CD automation delivers the most leverage when it eliminates repetitive pipeline boilerplate without hiding high-consequence release decisions. A shared workflow should be engineered as a versioned contract: consuming teams must clearly see its inputs, security permissions, artifact outputs, and state-mutating boundaries.
In my open-source shipguard repository (formerly ci-template), reusable GitHub Actions workflows (workflow_call) standardize security scanning, build and test for Go, Node.js, Python, Ruby, and Rust, and releases of scanned, signed images versioned by shiptag. Centralizing these pipelines reduces maintenance drift across dozens of services—provided three architectural boundaries remain strict.
1. Inputs express policy choices, not template internals
Callers should declare runtime versions, linting strictness, target platforms, and release modes explicitly. Sensible defaults accelerate adoption, but any setting that alters security posture or artifact promotion should be visible at the call site:
jobs:
ci:
uses: faridlamaul/shipguard/.github/workflows/build-test.yml@v1.4.0
permissions:
contents: read
security:
uses: faridlamaul/shipguard/.github/workflows/scan.yml@v1.4.0
permissions: { contents: read, security-events: write, actions: read }
with:
scanners: all
mode: enforce
2. Permissions match side effects
A verification workflow that runs unit tests and static analysis should never inherit write privileges just because the same repository also hosts a release workflow. Defaulting reusable workflows to contents: read and requiring callers to opt into contents: write or packages: write only on isolated release jobs enforces least privilege by construction.
3. Separate verification from publication
Linting, testing, Trivy container scanning, and Gitleaks secret detection establish evidence about a commit. Tagging a release, pushing a multi-arch container image, or syncing a Helm environment mutates shared state. Keeping verification workflows side-effect-free—and supporting --dry-run release previews before tag creation—lets teams adopt shared automation with confidence.