CICD-107 · Create a reusable workflow input contract
Encyclopedia · Workflow reuse and caching · All snippets
Previous · CICD-106 · Next · CICD-108
1. Where it fits
- Placement At workflow scope in the provider's
.github/workflows/reuse.yml. - Prerequisites trusted checkout and cache/artifact support verified on the chosen Actions runner.
- Platforms github-actions, gitea-actions.
2. Copy the snippet
yaml
on:
workflow_call:
inputs:
mode:
type: string
default: quick3. How it works
workflow_call exposes a reusable workflow entry point and types its input. Callers must supply the declared name and the provider reads inputs.mode.
4. Verify the result
Add actual jobs and use inputs.mode for selected behavior.
Watch for. Place event filters at workflow scope and test an event that should run and an event that should be skipped.
Validation syntax-validated (YAML parse). Status definitions.